mirror of
https://github.com/postgres/postgres.git
synced 2025-04-24 10:47:04 +03:00
pg_upgrade: Handle default_transaction_read_only settings
Setting default_transaction_read_only=true could prevent pg_upgrade from completing, so prepend default_transaction_read_only=false to PGOPTIONS.
This commit is contained in:
parent
4bd371f6f8
commit
e7d56aee2d
@ -25,6 +25,7 @@
|
||||
static void usage(void);
|
||||
static void check_required_directory(char **dirpath, char **configpath,
|
||||
char *envVarName, char *cmdLineOption, char *description);
|
||||
#define FIX_DEFAULT_READ_ONLY "-c default_transaction_read_only=false"
|
||||
|
||||
|
||||
UserOpts user_opts;
|
||||
@ -208,6 +209,17 @@ parseCommandLine(int argc, char *argv[])
|
||||
fclose(fp);
|
||||
}
|
||||
|
||||
/* Turn off read-only mode; add prefix to PGOPTIONS? */
|
||||
if (getenv("PGOPTIONS"))
|
||||
{
|
||||
char *pgoptions = psprintf("%s %s", FIX_DEFAULT_READ_ONLY,
|
||||
getenv("PGOPTIONS"));
|
||||
pg_putenv("PGOPTIONS", pgoptions);
|
||||
pfree(pgoptions);
|
||||
}
|
||||
else
|
||||
pg_putenv("PGOPTIONS", FIX_DEFAULT_READ_ONLY);
|
||||
|
||||
/* Get values from env if not already set */
|
||||
check_required_directory(&old_cluster.bindir, NULL, "PGBINOLD", "-b",
|
||||
"old cluster binaries reside");
|
||||
|
Loading…
x
Reference in New Issue
Block a user