1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-27 23:21:58 +03:00

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

Commit 7102070329 fixed a similar bug, but
it missed the case of database-wide ANALYZE ("use_own_xacts" mode).
Commit a07e03fd8f 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
This commit is contained in:
Noah Misch
2025-04-20 08:28:48 -07:00
parent 3f9132ed28
commit d34b671a63
4 changed files with 65 additions and 0 deletions

View File

@ -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