pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Noah Misch <noah@leadboat.com>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: Avoid ERROR at ON COMMIT DELETE ROWS after relhassubclass=f.
Date: Sun, 20 Apr 2025 15:30:17 +0000
Message-ID: <E1u6Wcb-000yA4-0r@gemulon.postgresql.org> (raw)

Avoid ERROR at ON COMMIT DELETE ROWS after relhassubclass=f.

Commit 7102070329d8147246d2791321f9915c3b5abf31 fixed a similar bug, but
it missed the case of database-wide ANALYZE ("use_own_xacts" mode).
Commit a07e03fd8fa7daf4d1356f7cb501ffe784ea6257 changed consequences
from silent discard of a pg_class stats (relpages et al.) update to
ERROR "tuple to be updated was already modified".  Losing a relpages
update of an ON COMMIT DELETE ROWS table was negligible, but a
COMMIT-time error isn't negligible.  Back-patch to v13 (all supported
versions).

Reported-by: Richard Guo <guofenglinux@gmail.com
Reported-by: Robins Tharakan <tharakan@gmail.com>
Discussion: https://postgr.es/m/CAMbWs4-XwMKMKJ_GT=p3_-_=j9rQSEs1FbDFUnW9zHuKPsPNEQ@mail.gmail.com
Backpatch-through: 13

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/d0a049987e5a0aab8bc79af889ff12349a325c97

Modified Files
--------------
src/backend/commands/vacuum.c                |  2 ++
src/test/regress/expected/maintain_every.out | 33 ++++++++++++++++++++++++++++
src/test/regress/parallel_schedule           |  4 ++++
src/test/regress/sql/maintain_every.sql      | 26 ++++++++++++++++++++++
4 files changed, 65 insertions(+)



view thread (6+ messages)  latest in thread

Message-ID: <E1u6Wcb-000yA4-0r@gemulon.postgresql.org>
Permalink:  ../E1u6Wcb-000yA4-0r@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1u6Wcb-000yA4-0r@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: noah@leadboat.com, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: Avoid ERROR at ON COMMIT DELETE ROWS after relhassubclass=f.
  In-Reply-To: <E1u6Wcb-000yA4-0r@gemulon.postgresql.org>

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

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