RE: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of f rying pan, into fire)
От | Michael Davis |
---|---|
Тема | RE: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of f rying pan, into fire) |
Дата | |
Msg-id | 93C04F1F5173D211A27900105AA8FCFC145294@lambic.prevuenet.com обсуждение исходный текст |
Список | pgsql-hackers |
However it is implemented, I would really enjoy this enhancement. Additionally, it would be nice if I could create a new operator using C and have this new operator be associative if desired. Speaking of this, If either LASTNAME or FIRSTNAME is NULL then the result of ((LASTNAME || ',' ) || FIRSTNAME) will return NULL. I would like to be able to alter this such that the result will contain what ever is not NULL. I tried to create a C function to overcome this but noticed that if any parameter in my C function is NULL then the C function always returns NULL. I saw some references in the archives about this issue but was unable to determine where it was left. What is the status of this issue? Thanks, Michael -----Original Message-----From: Bruce Momjian [SMTP:maillist@candle.pha.pa.us]Sent: Tuesday, March 16, 1999 3:24 PMTo: clark.evans@manhattanproject.comCc: hackers@postgreSQL.orgSubject: Re: [HACKERS] Associative Operators? (Was:Re: [NOVICE] Out of frying pan, into fire) > Seth McQuale pointed out that the follwing does not work:> SELECT LASTNAME || ',' || FIRSTNAME [AS] NAME FROM FRIENDS;>> The solution, was:> SELECT ( LASTNAME || ',' ) || FIRSTNAME AS NAME FROM FRIENDS;> > I looked at pg_operatorand didn't see any flag to mark> an operator as 'associative'. Perhaps if we added a flag> like this, the re-writesystem could be modified to handle> cases like this.> > Thoughts?> > Clark Evans> > My guess is that we should auto-left-associate functions like || if noparens are present. It would be a small change to the parser. -- Bruce Momjian | http://www.op.net/~candle maillist@candle.pha.pa.us | (610) 853-3000 + If your life is a hard drive, | 830 Blythe Avenue + Christ can be your backup. | Drexel Hill,Pennsylvania 19026
В списке pgsql-hackers по дате отправления: