aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorNathan Bossart <nathan@postgresql.org>2024-10-07 16:49:20 -0500
committerNathan Bossart <nathan@postgresql.org>2024-10-07 16:49:20 -0500
commitce6f27857bba9e380a10365abf798dfbf453cc31 (patch)
tree071a625aafa6c9cc9c790ab116d5036e161d0be7 /src
parent5cea7168dfe622fe2e474bdfae59f966aad53ce3 (diff)
downloadpostgresql-ce6f27857bba9e380a10365abf798dfbf453cc31.tar.gz
postgresql-ce6f27857bba9e380a10365abf798dfbf453cc31.zip
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
Diffstat (limited to 'src')
-rw-r--r--src/bin/scripts/vacuumdb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bin/scripts/vacuumdb.c b/src/bin/scripts/vacuumdb.c
index 1792c35e592..dac0eac71b9 100644
--- a/src/bin/scripts/vacuumdb.c
+++ b/src/bin/scripts/vacuumdb.c
@@ -623,7 +623,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");
/*