Re: pg_stat_statements replaces SQL/JSON ON EMPTY / ON ERROR keywords with parameters

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Staroverov Ilja <i(dot)staroverov(at)ftdata(dot)ru>
Cc: Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: pg_stat_statements replaces SQL/JSON ON EMPTY / ON ERROR keywords with parameters
Date: 2026-10-23 08:02:06
Message-ID: atsUfsDjdudiJAL9@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On Thu, Oct 22, 2026 at 10:52:28AM +0000, Staroverov Ilja wrote:
> 0001 fixes all of them in the new tests, for example:

errmsg("cannot cast behavior expression of type %s to %s",
format_type_be(exprType(expr)),
format_type_be(returning->typid)),
- parser_errposition(pstate, exprLocation(expr)));
+ parser_errposition(pstate, location));

While looking at v5-0001, I have been puzzled by this piece, because
it is actually not reachable with any normal means or even SQL.
Anyway, I get that Amit wanted this part to be defensive, so your
suggestion of using the behavior's location sounds good to me.

Applied this part.
--
Michael

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Richard Guo 2026-10-23 07:40:19 Re: BUG #19765: Wrong result from a chain of LEFT JOINs since v16