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

Commite7d56ae

Browse files
committed
pg_upgrade: Handle default_transaction_read_only settings
Setting default_transaction_read_only=true could prevent pg_upgrade fromcompleting, so prepend default_transaction_read_only=false toPGOPTIONS.
1 parent4bd371f commite7d56ae

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

‎contrib/pg_upgrade/option.c

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
staticvoidusage(void);
2626
staticvoidcheck_required_directory(char**dirpath,char**configpath,
2727
char*envVarName,char*cmdLineOption,char*description);
28+
#defineFIX_DEFAULT_READ_ONLY "-c default_transaction_read_only=false"
2829

2930

3031
UserOptsuser_opts;
@@ -208,6 +209,17 @@ parseCommandLine(int argc, char *argv[])
208209
fclose(fp);
209210
}
210211

212+
/* Turn off read-only mode; add prefix to PGOPTIONS? */
213+
if (getenv("PGOPTIONS"))
214+
{
215+
char*pgoptions=psprintf("%s %s",FIX_DEFAULT_READ_ONLY,
216+
getenv("PGOPTIONS"));
217+
pg_putenv("PGOPTIONS",pgoptions);
218+
pfree(pgoptions);
219+
}
220+
else
221+
pg_putenv("PGOPTIONS",FIX_DEFAULT_READ_ONLY);
222+
211223
/* Get values from env if not already set */
212224
check_required_directory(&old_cluster.bindir,NULL,"PGBINOLD","-b",
213225
"old cluster binaries reside");

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp