public inbox for [email protected]
help / color / mirror / Atom feedFrom: Laurenz Albe <[email protected]>
To: Charles Qi <[email protected]>
Cc: Adrian Klaver <[email protected]>
Cc: [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
Date: Wed, 13 Aug 2025 07:14:48 +0200
Message-ID: <[email protected]> (raw)
In-Reply-To: <CAEawgc++MEp-Cgrpg0NR+9hg4ZhzKPWdnf9pPvheXTrew=kkJA@mail.gmail.com>
References: <CAEawgcJN2V0MTzZu5gi=csNapnJzogxJJqUFSphu6r=OXjorng@mail.gmail.com>
<[email protected]>
<CAEawgcLdD3-4Co8mrR7UaXJLGgBwSecUs-1QxyY3VoJzN9bnmg@mail.gmail.com>
<[email protected]>
<CAEawgc++MEp-Cgrpg0NR+9hg4ZhzKPWdnf9pPvheXTrew=kkJA@mail.gmail.com>
On Mon, 2025-08-11 at 11:34 +0800, Charles Qi wrote:
> The trigger function in example is doing nothing but return new, the
> row is actually locked by the trigger itself (trigger.c >
> ExecBRUpdateTriggers > GetTupleForTrigger)
>
> You mentioned a very important behavior:
> > A multixact is only necessary
> > if a subtransaction needs to take a stronger lock on the row than what
> > was there before.
>
> We are doing two no key updates in example, and should not need a
> stronger lock on the same row.
Still, you could explicitly lock the row in the trigger function with
a high enough lock level to avoid a multixact being created later on.
Yours,
Laurenz Albe
view thread (5+ messages)
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], [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: <[email protected]>
* 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