pgsql: vacuumdb: Skip temporary tables in query to build list of relati

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: vacuumdb: Skip temporary tables in query to build list of relati
Date: 2024-09-25 05:45:38
Message-ID: E1stKqI-000nGv-76@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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_15_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/74eaa0544abf84d82bceb80e6f66321ec4c92c82

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

Browse pgsql-committers by date

  From Date Subject
Next Message Alvaro Herrera 2024-09-25 14:47:28 pgsql: Turn 'if' condition around to avoid Svace complaint
Previous Message Amit Kapila 2024-09-25 04:38:12 pgsql: Doc: Add the steps for upgrading the logical replication cluster