Re: Query Jumbling for CALL and SET utility statements

From: "Drouvot, Bertrand" <bertranddrouvot(dot)pg(at)gmail(dot)com>
To: Fujii Masao <masao(dot)fujii(at)oss(dot)nttdata(dot)com>, Julien Rouhaud <rjuju123(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Jeremy Schneider <schnjere(at)amazon(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>, Andres Freund <andres(at)anarazel(dot)de>, "Imseih (AWS), Sami" <simseih(at)amazon(dot)com>
Subject: Re: Query Jumbling for CALL and SET utility statements
Date: 2022-09-19 06:29:22
Message-ID: 6d0d8a57-0e9c-7fcb-5072-aae544dafa5c@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 9/16/22 5:47 PM, Drouvot, Bertrand wrote:
> Hi,
>
> On 9/16/22 2:53 PM, Fujii Masao wrote:
>>
>>
>>> Attached v5 to normalize 2PC commands too, so that we get things like:
>>
>> +        case T_VariableSetStmt:
>> +            {
>> +                VariableSetStmt *stmt = (VariableSetStmt *) node;
>> +
>> +                /* stmt->name is NULL for RESET ALL */
>> +                if (stmt->name)
>> +                {
>> +                    APP_JUMB_STRING(stmt->name);
>> +                    JumbleExpr(jstate, (Node *) stmt->args);
>>
>> With the patch, "SET ... TO DEFAULT" and "RESET ..." are counted as
>> the same query.
>> Is this intentional?
>
> Thanks for looking at the patch!
> No, it is not intentional, good catch!
>
>> Which might be ok because their behavior is basically the same.
>> But I'm afaid which may cause users to be confused. For example, they
>> may fail to
>> find the pgss entry for RESET command they ran and just wonder why the
>> command was
>> not recorded. To avoid such confusion, how about appending stmt->kind
>> to the jumble?
>> Thought?
>
> I think that's a good idea and will provide a new version taking care of
> it (and also Sami's comments up-thread).

Please find attached v6 taking care of the remarks mentioned above.

Regards,

--
Bertrand Drouvot
PostgreSQL Contributors Team
RDS Open Source Databases
Amazon Web Services: https://aws.amazon.com

Attachment Content-Type Size
v6-0001-JumbleQuery-on-Call-and-Set.patch text/plain 23.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Smith 2022-09-19 06:51:31 Re: Data is copied twice when specifying both child and parent table in publication
Previous Message John Naylor 2022-09-19 06:21:20 Re: Support for Rust