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

From: Staroverov Ilja <i(dot)staroverov(at)ftdata(dot)ru>
To: Michael Paquier <michael(at)paquier(dot)xyz>, Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>
Cc: "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-27 04:50:27
Message-ID: B7456AD1-314D-4B65-AB7B-F1827C0593C9@localhost.localdomain
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi,

On Tue, Oct 27, 2026 at 08:28:52AM +0900, Michael Paquier wrote:
> On Mon, Oct 26, 2026 at 01:23:22PM -0500, Sami Imseih wrote:
>> So I think `JsonExpr.column_name` should be marked `query_jumble_ignore`
>> instead of using a custom query jumble function.

Agreed, thanks. This is consistent with the column definition lists
of functions in FROM, and it also merges a column without PATH with
the same column with an explicit PATH, which v5 kept apart.

> Okay. How would this choice impact the PGSS outputs? Perhaps we
> should first expand the tests with PATH keywords touching multiple
> columns first?

Attached is v6. 0001 adds tests with several columns, with and
without PATH, and with an explicit PATH equal to the one derived from
the column name. On master, the queries of this test block with the
same number of columns are all merged into a single entry, as the
column definitions are not part of the query ID.

0002 is the JSON_TABLE jumbling, with JsonExpr.column_name marked
query_jumble_ignore instead of the custom jumble function. For these
tests, its diff shows the same two entries as on master, with the
paths shown as parameter symbols. Compared to v5, the only change in
the expected output of the existing tests is that COLUMNS (a int) and
COLUMNS (b int) are now merged with the other queries with one column.

--
Ilya Staroverov

Attachment Content-Type Size
v6-0001-pg_stat_statements-Add-tests-for-JSON_TABLE-colum.patch application/octet-stream 3.9 KB
v6-0002-Include-JSON_TABLE-column-definitions-in-query-ju.patch application/octet-stream 20.4 KB

In response to

Browse pgsql-bugs by date

  From Date Subject
Previous Message Takeshi Ideriha 2026-10-27 04:14:31 Re: BUG #19777: PERIOD foreign key rejects an empty referencing range even though the referenced period covers it