Re: When UPDATE a row in a table with BEFORE ROW UPDATE trigger, the XMAX of new tuple is set to current XID

2025-08-11 Thread Charles Qi
On Mon, Aug 11, 2025 at 3:34 AM Laurenz Albe wrote: > > On Fri, 2025-08-08 at 09:20 +0800, Charles Qi wrote: > > Let me clarify the question, when the BEFORE ROW UPDATE trigger is presented > > Q. Why do we need to set the XMAX of the new tuple to the current xid? > > Bec

Re: When UPDATE a row in a table with BEFORE ROW UPDATE trigger, the XMAX of new tuple is set to current XID

2025-08-08 Thread Charles Qi
presented Q. Why do we need to set the XMAX of the new tuple to the current xid? which risks piling up multixacts quickly in savepoint/exception block scenarios. On Thu, Aug 7, 2025 at 2:22 AM Adrian Klaver wrote: > > On 8/6/25 05:37, Charles Qi wrote: > > And if we do the updates

When UPDATE a row in a table with BEFORE ROW UPDATE trigger, the XMAX of new tuple is set to current XID

2025-08-06 Thread Charles Qi
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-p