diff options
Diffstat (limited to 'contrib/pg_upgrade/pg_upgrade.c')
-rw-r--r-- | contrib/pg_upgrade/pg_upgrade.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/contrib/pg_upgrade/pg_upgrade.c b/contrib/pg_upgrade/pg_upgrade.c index ea1f9f663e4..b32d81efe71 100644 --- a/contrib/pg_upgrade/pg_upgrade.c +++ b/contrib/pg_upgrade/pg_upgrade.c @@ -540,9 +540,8 @@ set_frozenxids(void) */ if (strcmp(datallowconn, "f") == 0) PQclear(executeQueryOrDie(conn_template1, - "UPDATE pg_catalog.pg_database " - "SET datallowconn = true " - "WHERE datname = '%s'", datname)); + "ALTER DATABASE %s ALLOW_CONNECTIONS = true", + quote_identifier(datname))); conn = connectToServer(&new_cluster, datname); @@ -558,9 +557,8 @@ set_frozenxids(void) /* Reset datallowconn flag */ if (strcmp(datallowconn, "f") == 0) PQclear(executeQueryOrDie(conn_template1, - "UPDATE pg_catalog.pg_database " - "SET datallowconn = false " - "WHERE datname = '%s'", datname)); + "ALTER DATABASE %s ALLOW_CONNECTIONS = false", + quote_identifier(datname))); } PQclear(dbres); |