diff options
author | Nathan Bossart | 2024-10-07 21:49:20 +0000 |
---|---|---|
committer | Nathan Bossart | 2024-10-07 21:49:20 +0000 |
commit | eba8cc1af8ec57aff99f11ef9cdf24a641c159b0 (patch) | |
tree | 40a03b40cfed760e1d94e44e095c98dfc6ef3b8b | |
parent | 8aaf88b63de3d6e665b0fcf1ff123f08b961fe66 (diff) |
vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
Commit 1ab67c9dfa, which modified this catalog query so that it
doesn't return temporary relations, forgot to schema-qualify the
operator. A comment earlier in the function implores us to fully
qualify everything in the query:
* Since we execute the constructed query with the default search_path
* (which could be unsafe), everything in this query MUST be fully
* qualified.
This commit fixes that. While at it, add a newline for consistency
with surrounding code.
Reviewed-by: Noah Misch
Discussion: https://postgr.es/m/ZwQJYcuPPUsF0reU%40nathan
Backpatch-through: 12
-rw-r--r-- | src/bin/scripts/vacuumdb.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c index 50b65b8a5c9..c59790cd123 100644 --- a/src/bin/scripts/vacuumdb.c +++ b/src/bin/scripts/vacuumdb.c @@ -694,7 +694,8 @@ vacuum_one_database(ConnParams *cparams, * Exclude temporary tables, beginning the WHERE clause. */ appendPQExpBufferStr(&catalog_query, - " WHERE c.relpersistence != " CppAsString2(RELPERSISTENCE_TEMP)); + " WHERE c.relpersistence OPERATOR(pg_catalog.!=) " + CppAsString2(RELPERSISTENCE_TEMP) "\n"); /* * Used to match the tables or schemas listed by the user, for the WHERE |