Re: BUG #15208: COALESCE with CTE returns NULL

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: klaxian(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #15208: COALESCE with CTE returns NULL
Date: 2018-05-25 16:24:44
Message-ID: 15880.1527265484@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

=?utf-8?q?PG_Bug_reporting_form?= <noreply(at)postgresql(dot)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

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2018-05-25 16:57:41 BUG #15209: Problem with string value in installer
Previous Message Sergei Kornilov 2018-05-25 16:24:42 Re: BUG #15208: COALESCE with CTE returns NULL