public inbox for [email protected]  
help / color / mirror / Atom feed
From: Álvaro Herrera <[email protected]>
To: [email protected]
Subject: pgsql: Skip other sessions' temp tables in REPACK, CLUSTER, and VACUUM
Date: Tue, 05 May 2026 14:23:31 +0000
Message-ID: <[email protected]> (raw)

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 <[email protected]>
Reviewed-by: Chao Li <[email protected]>
Reviewed-by: Zsolt Parragi <[email protected]>
Discussion: https://postgr.es/m/[email protected]

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/a0a0c0c20ec5f8787bb1be5f476c4e59f6810634

Modified Files
--------------
src/backend/commands/repack.c | 25 ++++++++++++++++++++++++-
src/backend/commands/vacuum.c |  5 +++++
2 files changed, 29 insertions(+), 1 deletion(-)



reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected]
  Subject: Re: pgsql: Skip other sessions' temp tables in REPACK, CLUSTER, and VACUUM
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox