XACT_EVENT for 'commit prepared'

From: Xiaoran Wang <fanfuxiaoran(at)gmail(dot)com>
To: pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: XACT_EVENT for 'commit prepared'
Date: 2024-06-07 09:14:29
Message-ID: CAGjhLkNuE5z=0ZOaO8veqcC8pq+rOnavoVHgoPqKqRnSXzvYmg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi hackers,

I found that in enum XactEvent, there is 'XACT_EVENT_PREPARE' for
'prepare transaction', but there is no event for 'commit prepared' or
'rollback prepared'.

For the following SQL:
------------------------------------------------
begin;
create table test(a int);
PREPARE TRANSACTION 'foo';
rollback prepared 'foo';
-------------------------------------------------
When executing ' rollback prepared 'foo'; ', I expected to get
'XACT_EVENT_ABORT', but actually,
the event type is 'XACT_EVENT_COMMIT'.

I think XACT_EVENT_COMMIT_PREPARED and XACT_EVENT_ROLLBACK_PREPARED can be
added in function 'FinishPreparedTransaction'

I'm confused why there are no related events for them.

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dilip Kumar 2024-06-07 09:14:35 Re: Compress ReorderBuffer spill files using LZ4
Previous Message Matthias van de Meent 2024-06-07 09:10:25 Re: use CREATE DATABASE STRATEGY = FILE_COPY in pg_upgrade