diff options
author | Noah Misch <noah@leadboat.com> | 2025-04-20 08:28:48 -0700 |
---|---|---|
committer | Noah Misch <noah@leadboat.com> | 2025-04-20 08:28:53 -0700 |
commit | d34b671a63e61d8e6002fb45f960d078e1073ea3 (patch) | |
tree | cf9fa8ace1cf545981d49297f1e0ef4002c2a5b2 /src/backend/commands | |
parent | 3f9132ed28228380d1eb223ad7b9db87f7fb9b08 (diff) |
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
Diffstat (limited to 'src/backend/commands')
-rw-r--r-- | src/backend/commands/vacuum.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/backend/commands/vacuum.c b/src/backend/commands/vacuum.c index c4321ff5bce..1fa71d11bcf 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -470,6 +470,8 @@ vacuum(List *relations, VacuumParams *params, if (use_own_xacts) { PopActiveSnapshot(); + /* standard_ProcessUtility() does CCI if !use_own_xacts */ + CommandCounterIncrement(); CommitTransactionCommand(); } else |