Re: Query Jumbling for CALL and SET utility statements

From: "Drouvot, Bertrand" <bdrouvot(at)amazon(dot)com>
To: 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-09 10:11:50
Message-ID: a0d66747-3f8c-5346-5baa-61299e2cb4da@amazon.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 9/8/22 6:07 PM, Drouvot, Bertrand wrote:
> On 9/8/22 1:29 PM, Julien Rouhaud wrote:
>>
>> IME if your application relies on 2PC it's very likely that you will hit the
>> exact same problems described in your original email.
>
> Agree
>
>> What do you think about
>> normalizing those too while working on the subject?
>
> That sounds reasonable, I'll have a look at those too while at it.
>
Attached v5 to normalize 2PC commands too, so that we get things like:

create table test_tx (a int);
begin;
prepare transaction 'tx1';
insert into test_tx values (1);
commit prepared 'tx1';
begin;
prepare transaction 'tx2';
insert into test_tx values (2);
commit prepared 'tx2';
begin;
prepare transaction 'tx3';
insert into test_tx values (3);
rollback prepared 'tx3';
begin;
prepare transaction 'tx4';
insert into test_tx values (4);
rollback prepared 'tx4';
SELECT query, calls, rows FROM pg_stat_statements ORDER BY query COLLATE
"C";
query                                     | calls | rows
------------------------------------------------------------------------------+-------+------
 SELECT pg_stat_statements_reset() |     1 |    1
 SELECT query, calls, rows FROM pg_stat_statements ORDER BY query
COLLATE "C" |     0 |    0
 begin |     4 |    0
 commit prepared $1 |     2 |    0
 create table test_tx (a
int)                                                 |     1 |    0
 insert into test_tx values
($1)                                              |     4 |    4
 prepare transaction
$1                                                       |     4 |    0
 rollback prepared
$1                                                         | 2 |    0
(8 rows)

For those ones I also had to do some minor changes in gram.y and to the
TransactionStmt struct to record the gid location.

Regards,

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

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Drouvot, Bertrand 2022-09-09 10:18:37 Re: Patch to address creation of PgStat* contexts with null parent context
Previous Message Dilip Kumar 2022-09-09 10:02:17 Re: making relfilenodes 56 bits