]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Avoid ERROR at ON COMMIT DELETE ROWS after relhassubclass=f.
authorNoah Misch <noah@leadboat.com>
Sun, 20 Apr 2025 15:28:48 +0000 (08:28 -0700)
committerNoah Misch <noah@leadboat.com>
Sun, 20 Apr 2025 15:28:53 +0000 (08:28 -0700)
commita61b67cd06c283d51cc833b4d1b990e6519836d8
tree49b1e560156a658a7d7fdd6657328ace9e03a3a5
parent3c2ea65bd85f16d563f896398251dd1337fc5856
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
src/backend/commands/vacuum.c
src/test/regress/expected/maintain_every.out [new file with mode: 0644]
src/test/regress/parallel_schedule
src/test/regress/sql/maintain_every.sql [new file with mode: 0644]