Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit64719a1

Browse files
committed
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 thebug.
1 parent60e7f45 commit64719a1

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

‎contrib/pg_upgrade/pg_upgrade.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -304,15 +304,14 @@ set_frozenxids(migratorContext *ctx)
304304
PQclear(executeQueryOrDie(ctx,conn,
305305
"UPDATE pg_catalog.pg_database "
306306
"SETdatfrozenxid = '%u' "
307-
/* cannot connect to 'template0', so ignore */
308-
"WHEREdatname != 'template0'",
307+
"WHERE datallowconn = true",
309308
ctx->old.controldata.chkpnt_nxtxid));
310309

311310
/* get database names */
312311
dbres=executeQueryOrDie(ctx,conn,
313312
"SELECTdatname "
314313
"FROMpg_catalog.pg_database "
315-
"WHEREdatname != 'template0'");
314+
"WHERE datallowconn = true");
316315

317316
/* free dbres below */
318317
PQfinish(conn);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp