diff options
Diffstat (limited to 'src/bin/pg_ctl/pg_ctl.c')
-rw-r--r-- | src/bin/pg_ctl/pg_ctl.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/src/bin/pg_ctl/pg_ctl.c b/src/bin/pg_ctl/pg_ctl.c index 56d238f3948..1f921819c23 100644 --- a/src/bin/pg_ctl/pg_ctl.c +++ b/src/bin/pg_ctl/pg_ctl.c @@ -1387,7 +1387,19 @@ pgwin32_CommandLine(bool registration) register_servicename); if (pg_config) - appendPQExpBuffer(cmdLine, " -D \"%s\"", pg_config); + { + /* We need the -D path to be absolute */ + char *dataDir; + + if ((dataDir = make_absolute_path(pg_config)) == NULL) + { + /* make_absolute_path already reported the error */ + exit(1); + } + make_native_path(dataDir); + appendPQExpBuffer(cmdLine, " -D \"%s\"", dataDir); + free(dataDir); + } if (registration && do_wait) appendPQExpBuffer(cmdLine, " -w"); |