8000 vacuumdb: Schema-qualify operator in catalog query's WHERE clause. · postgres/postgres@8318f2b · GitHub
[go: up one dir, main page]

Skip to content
  • Commit 8318f2b

    Browse files
    vacuumdb: Schema-qualify operator in catalog query's WHERE clause.
    Commit 1ab67c9, 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
    1 parent 5d6187d commit 8318f2b

    File tree

    1 file changed

    +2
    -1
    lines changed

    1 file changed

    +2
    -1
    lines changed

    src/bin/scripts/vacuumdb.c

    Lines changed: 2 additions & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -684,7 +684,8 @@ vacuum_one_database(ConnParams *cparams,
    684684
    * Exclude temporary tables, beginning the WHERE clause.
    685685
    */
    686686
    appendPQExpBufferStr(&catalog_query,
    687-
    " WHERE c.relpersistence != " CppAsString2(RELPERSISTENCE_TEMP));
    687+
    " WHERE c.relpersistence OPERATOR(pg_catalog.!=) "
    688+
    CppAsString2(RELPERSISTENCE_TEMP) "\n");
    688689

    689690
    /*
    690691
    * Used to match the tables or schemas listed by the user, for the WHERE

    0 commit comments

    Comments
     (0)
    0