Re: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of frying pan, into fire) - Mailing list pgsql-hackers

From Clark Evans
Subject Re: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of frying pan, into fire)
Date
Msg-id 36EEE7C0.2986D5A0@manhattanproject.com
Whole thread Raw
In response to RE: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of f rying pan, into fire)  (Michael Davis <michael.davis@prevuenet.com>)
List pgsql-hackers
Michael Davis wrote:
> 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?

Although I feel initial opposition to this idea, on second 
consideration, I guess it is  reasonable behavior, in Oracle, 
the NVL function and the DECODE function both handle NULL 
arguments without having the result be NULL.

However, I'm unaware of any other exceptions in the Oracle
database on this issue.  I believe that user defined functions 
are not allowed to have special NULL treatment -- perhaps 
Oracle has DECODE and NVL hard coded deep in the guts of 
their query processor, while the other functions arn't.

Would a compromise be to add DECODE and NVL ?

Clark


pgsql-hackers by date:

Previous
From: Michael Davis
Date:
Subject: RE: [HACKERS] Associative Operators? (Was: Re: [NOVICE] Out of f rying pan, into fire)
Next
From: Michael Davis
Date:
Subject: RE: [HACKERS] parser enhancement request for 6.5