]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Skip other sessions' temp tables in REPACK, CLUSTER, and VACUUM FULL
authorÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 5 May 2026 14:20:26 +0000 (16:20 +0200)
committerÁlvaro Herrera <alvherre@kurilemu.de>
Tue, 5 May 2026 14:20:26 +0000 (16:20 +0200)
commita0a0c0c20ec5f8787bb1be5f476c4e59f6810634
tree50c4fed9bf915a763b87204a8e163cba0b2295ee
parent6766264262851686481dee4401541ee8cd874c2a
Skip other sessions' temp tables in REPACK, CLUSTER, and VACUUM FULL

get_tables_to_repack() and get_all_vacuum_rels() were including other
sessions' temporary tables in their output work list, causing REPACK,
CLUSTER and VACUUM FULL (when executed without a table list) to attempt
to acquire AccessExclusiveLock on them, potentially blocking for an
extended time.  Fix by skipping other-session temp tables early, before
they are added to the list.

This issue is ancient, but there have been no complaints about it that I
know of, so I'm opting for not backpatching at present.

Author: Jim Jones <jim.jones@uni-muenster.de>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Zsolt Parragi <zsolt.parragi@percona.com>
Discussion: https://postgr.es/m/0b555318-2bf2-46df-9377-09629a2a59db@uni-muenster.de
src/backend/commands/repack.c
src/backend/commands/vacuum.c