summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/option.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/option.c')
-rw-r--r--contrib/pg_upgrade/option.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/contrib/pg_upgrade/option.c b/contrib/pg_upgrade/option.c
index 735ee6758d1..04cef630e10 100644
--- a/contrib/pg_upgrade/option.c
+++ b/contrib/pg_upgrade/option.c
@@ -52,6 +52,7 @@ parseCommandLine(int argc, char *argv[])
int option; /* Command line option */
int optindex = 0; /* used by getopt_long */
int os_user_effective_id;
+ PQExpBufferData userbuf;
user_opts.transfer_mode = TRANSFER_MODE_COPY;
@@ -211,6 +212,11 @@ parseCommandLine(int argc, char *argv[])
"old cluster data resides");
validateDirectoryOption(&new_cluster.pgdata, "NEWDATADIR", "-D",
"new cluster data resides");
+
+ initPQExpBuffer(&userbuf);
+ appendShellString(&userbuf, os_info.user);
+ /* Abandon struct, but keep its buffer until process exit. */
+ os_info.user_shell_arg = userbuf.data;
}