Re: BUG #15208: COALESCE with CTE returns NULL - Mailing list pgsql-bugs

From Rick Gabriel
Subject Re: BUG #15208: COALESCE with CTE returns NULL
Date
Msg-id CACvJEPYimL3LdAgCXncyW2q3aEaPSo1RScGa12XrcpQs=30=aw@mail.gmail.com
Whole thread Raw
In response to Re: BUG #15208: COALESCE with CTE returns NULL  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-bugs
I'm very sorry to have bothered you. I thought this was a pg problem, but it's not. It appears to be a bug in a GUI wrapper I'm using to issue the queries. When using the psql client, everything works as expected. I will file a separate bug report for the GUI. Please disregard this bug report.

On Fri, May 25, 2018 at 12:24 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
PG Bug reporting form <noreply@postgresql.org> writes:
> When using COALESCE with an aggregate subquery to a CTE, NULL is returned
> instead of the first non-null value in the argument list. Proof-of-concept
> examples are below. I would expect COALESCE to return 0 in these cases. Am I
> missing something? Thanks.

Um ... I get zero from each of your test cases, in all PG versions back
to 9.3.

                        regards, tom lane

pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15209: Problem with string value in installer
Next
From: PG Bug reporting form
Date:
Subject: BUG #15210: Internal Server Error When Attempting to Look at TriggerFunctions