COALESCE documentation

2024-07-02 Thread Navrátil , Ondřej
Hello, as per documentation > The COALESCE function returns the first of its arguments that is not null. Null is returned only if all arguments are null. This is not exactly true. In fact: The COAL

Re: COALESCE documentation

2024-07-03 Thread Laurenz Albe
On Tue, 2024-07-02 at 12:45 +0200, Navrátil, Ondřej wrote: > as per documentation  > >  The COALESCE function returns the first of its arguments that is not null. > > Null is returned only if all arguments are null. > > This is not exactly true. In fact: > The COALESCE function returns the first

Re: COALESCE documentation

2024-07-03 Thread Peter Eisentraut
On 02.07.24 12:45, Navrátil, Ondřej wrote: Hello, as per documentation > The |COALESCE| function returns the first of its arguments that is not null. Null is returned only if all arguments are n

Re: COALESCE documentation

2024-07-03 Thread Laurenz Albe
On Wed, 2024-07-03 at 11:00 +0200, Peter Eisentraut wrote: > On 02.07.24 12:45, Navrátil, Ondřej wrote: > > as per documentation > > > > > The |COALESCE| function returns the first of its arguments

Re: COALESCE documentation

2024-07-03 Thread Navrátil , Ondřej
I do not have the specs on hand. But if the CASE equivalence should hold, then I deduce that COALESCE ( ROW(NULL, 1), ROW(NULL, 2)) results in ROW(NULL, 2) COALESCE ( ROW(NULL, 2), ROW(NULL, 1)) results in ROW(NULL, 1) I understand that order of parameters for coalesce matters for parameters that

Re: COALESCE documentation

2024-07-03 Thread David G. Johnston
On Wednesday, July 3, 2024, Navrátil, Ondřej wrote: > > To get back to my "docs patch proposal" - I could submit a patch if you > would kindly point me where to start. I would also prefer to submit such a > patch only after it is decided whether this is a docs bug or impl bug, and > whether or no

Re: COALESCE documentation

2024-07-03 Thread Laurenz Albe
On Wed, 2024-07-03 at 11:42 +0200, Navrátil, Ondřej wrote: > On a side note, I tested similar behavior in Oracle databases, and for them, > something like  > select testtype(null, null) is null; -- returns 0 (false) > select testtype(null, null) is not null; -- returns 1 (true) > ...and as far as

Re: COALESCE documentation

2024-07-03 Thread Tom Lane
. Having said that, I'm not sure that substituting "is distinct from null" in the COALESCE documentation is much better, because it's not clear to me that we're entirely standards-compliant about what that means for rowtypes either. regards, tom lane