diff options
author | Noah Misch | 2025-04-20 15:28:48 +0000 |
---|---|---|
committer | Noah Misch | 2025-04-20 15:28:48 +0000 |
commit | 2d5350cfbdc6e61124214d68713295bb060bc541 (patch) | |
tree | 6088897867f4840f6a2d9802cb48e28a2f78f9bc /src/backend | |
parent | d47f922246b54f0290811951e0b73a3d6110437c (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 <[email protected]
Reported-by: Robins Tharakan <[email protected]>
Discussion: https://postgr.es/m/CAMbWs4-XwMKMKJ_GT=p3_-_=j9rQSEs1FbDFUnW9zHuKPsPNEQ@mail.gmail.com
Backpatch-through: 13
Diffstat (limited to 'src/backend')
-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 db5da3ce826..33a33bf6b1c 100644 --- a/src/backend/commands/vacuum.c +++ b/src/backend/commands/vacuum.c @@ -657,6 +657,8 @@ vacuum(List *relations, VacuumParams *params, BufferAccessStrategy bstrategy, if (use_own_xacts) { PopActiveSnapshot(); + /* standard_ProcessUtility() does CCI if !use_own_xacts */ + CommandCounterIncrement(); CommitTransactionCommand(); } else |