Jumble the CALL command in pg_stat_statements

From: "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
To: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)fr>
Subject: Jumble the CALL command in pg_stat_statements
Date: 2023-09-13 00:48:48
Message-ID: B44FA29D-EBD0-4DD9-ABC2-16F1CB087074@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

The proposal by Bertrand in CC to jumble CALL and SET in [1] was
rejected at the time for a more robust solution to jumble DDL.

Michael also in CC made this possible with commit 3db72ebcbe.

The attached patch takes advantage of the jumbling infrastructure
added in the above mentioned commit and jumbles the CALL statement
in pg_stat_statements.

The patch also modifies existing test cases for CALL handling in pg_stat_statements
and adds additional tests which prove that a CALL to an overloaded procedure
will generate a different query_id.

As far as the SET command mentioned in [1] is concerned, it is a bit more complex
as it requires us to deal with A_Constants which is not very straightforward. We can surely
deal with SET currently by applying custom query jumbling logic to VariableSetStmt,
but this can be dealt with in a separate discussion.

Regards,

Sami Imseih
Amazon Web Services (AWS)

[1] https://www.postgresql.org/message-id/flat/36e5bffe-e989-194f-85c8-06e7bc88e6f7%40amazon.com

Attachment Content-Type Size
0001-v1-Jumble-the-CALL-command-in-pg_stat_statements.patch application/octet-stream 3.8 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kyotaro Horiguchi 2023-09-13 00:59:22 Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)
Previous Message Ranier Vilela 2023-09-13 00:40:04 Re: Avoid a possible null pointer (src/backend/utils/adt/pg_locale.c)