mirror of
https://git.postgresql.org/git/postgresql.git
synced 2024-12-03 08:00:21 +08:00
Use a 'datallowconn' check for avoiding 'template0', rather than
hardcoding a 'template0' check, per suggestion from Alvaro. This might fix a problem where someone has allowed 'template0' connections, but it is a cleaner approach even if doesn't fix the bug.
This commit is contained in:
parent
60e7f45966
commit
64719a18db
@ -304,15 +304,14 @@ set_frozenxids(migratorContext *ctx)
|
||||
PQclear(executeQueryOrDie(ctx, conn,
|
||||
"UPDATE pg_catalog.pg_database "
|
||||
"SET datfrozenxid = '%u' "
|
||||
/* cannot connect to 'template0', so ignore */
|
||||
"WHERE datname != 'template0'",
|
||||
"WHERE datallowconn = true",
|
||||
ctx->old.controldata.chkpnt_nxtxid));
|
||||
|
||||
/* get database names */
|
||||
dbres = executeQueryOrDie(ctx, conn,
|
||||
"SELECT datname "
|
||||
"FROM pg_catalog.pg_database "
|
||||
"WHERE datname != 'template0'");
|
||||
"WHERE datallowconn = true");
|
||||
|
||||
/* free dbres below */
|
||||
PQfinish(conn);
|
||||
|
Loading…
Reference in New Issue
Block a user