Re: Function's LEAST, GREATEST and DECODE (Oracle vararg polymorphic functions) - Mailing list pgsql-patches

From Tom Lane
Subject Re: Function's LEAST, GREATEST and DECODE (Oracle vararg polymorphic functions)
Date
Msg-id 21609.1119580015@sss.pgh.pa.us
Whole thread Raw
In response to Function's LEAST, GREATEST and DECODE (Oracle vararg polymorphic functions)  (Pavel Stehule <stehule@kix.fsv.cvut.cz>)
Responses Re: Function's LEAST, GREATEST and DECODE (Oracle vararg
List pgsql-patches
Pavel Stehule <stehule@kix.fsv.cvut.cz> writes:
+             /* If any argument is null, then result is null (for GREATEST and LEAST)*/

Are you sure about that?  The only reference I could find says that
these functions are not strict in Oracle:

http://download-east.oracle.com/otn_hosted_doc/rdb/pdf/sql_ref_v71_vol1.pdf
on page 2-185:

 The NULL keyword can appear in the list but is ignored. However, not all
 value expressions can be specified as NULL. That is, a non-NULL value
 expression must be in the list so that the data type for the expression
 can be determined.
 The GREATEST and LEAST functions can result in NULL only if at run time
 all value expressions result in NULL.

The strict interpretation is mathematically cleaner, no doubt, but
offhand it seems less useful.

            regards, tom lane

pgsql-patches by date:

Previous
From: Neil Conway
Date:
Subject: Re: Another unused variable
Next
From: Tatsuo Ishii
Date:
Subject: Re: EUC_JP and SJIS conversion improvement