public inbox for [email protected]  
help / color / mirror / Atom feed
From: Charles Qi <[email protected]>
To: [email protected]
Subject: When UPDATE a row in a table with BEFORE ROW UPDATE trigger, the XMAX of new tuple is set to current XID
Date: Wed, 6 Aug 2025 20:37:49 +0800
Message-ID: <CAEawgcJN2V0MTzZu5gi=csNapnJzogxJJqUFSphu6r=OXjorng@mail.gmail.com> (raw)

And if we do the updates in multiple subtransactions, multixact will be
created, which is not created when the BEFORE ROW UPDATE trigger is absent.

Is this behavior by design? If so, what is the purpose for the behavior?

Tested version:
PostgreSQL 14.18 (Ubuntu 14.18-0ubuntu0.22.04.1) on x86_64-pc-linux-gnu,
compiled by gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0, 64-bit

The attached file reproduce.sql can be used to reproduce the behavior.


Attachments:

  [application/octet-stream] reproduce.sql (3.3K, 3-reproduce.sql)
  download

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: When UPDATE a row in a table with BEFORE ROW UPDATE trigger, the XMAX of new tuple is set to current XID
  In-Reply-To: <CAEawgcJN2V0MTzZu5gi=csNapnJzogxJJqUFSphu6r=OXjorng@mail.gmail.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox