pg.ddx.io  pgsql-committers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: pgsql-committers@lists.postgresql.org
Subject: pgsql: vacuumdb: Skip temporary tables in query to build list of relati
Date: Wed, 25 Sep 2024 05:45:38 +0000
Message-ID: <E1stKqI-000nH3-8A@gemulon.postgresql.org> (raw)

vacuumdb: Skip temporary tables in query to build list of relations

Running vacuumdb with a non-superuser while another user has created a
temporary table would lead to a mid-flight permission failure,
interrupting the operation.  vacuum_rel() skips temporary relations of
other backends, and it makes no sense for vacuumdb to know about these
relations, so let's switch it to ignore temporary relations entirely.

Adding a qual in the query based on relpersistence simplifies the
generation of its WHERE clause in vacuum_one_database(), per se the
removal of "has_where".

Author: VaibhaveS, Michael Paquier
Reviewed-by: Fujii Masao
Discussion: https://postgr.es/m/CAM_eQjwfAR=y3G1fGyS1U9FTmc+FyJm9amNfY2QCZBnDDbNPZg@mail.gmail.com
Backpatch-through: 12

Branch
------
REL_13_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/9db4598c9c984d41896d517ff53b7b0cfbb3dc2e

Modified Files
--------------
src/bin/scripts/vacuumdb.c | 26 ++++++++++++++++----------
1 file changed, 16 insertions(+), 10 deletions(-)



view thread (7+ messages)  latest in thread

Message-ID: <E1stKqI-000nH3-8A@gemulon.postgresql.org>
Permalink:  ../E1stKqI-000nH3-8A@gemulon.postgresql.org/
Also on:    postgresql.org/message-id/E1stKqI-000nH3-8A@gemulon.postgresql.org

 · 

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: pgsql-committers@postgresql.org
  Cc: michael@paquier.xyz, pgsql-committers@lists.postgresql.org
  Subject: Re: pgsql: vacuumdb: Skip temporary tables in query to build list of relati
  In-Reply-To: <E1stKqI-000nH3-8A@gemulon.postgresql.org>

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

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