From 75dbfe4ca70d5b7a83f61b0a66a0a14ad0b739ed Mon Sep 17 00:00:00 2001 From: Alvaro Herrera Date: Tue, 2 Mar 2021 15:39:34 -0300 Subject: [PATCH] Use native path separators to pg_ctl in initdb MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit On Windows, CMD.EXE allegedly does not run a command that uses forward slashes, so let's convert the path to use backslashes instead. Backpatch to 10. Author: Nitin Jadhav Reviewed-by: Juan José Santamaría Flecha Discussion: https://postgr.es/m/CAMm1aWaNDuaPYFYMAqDeJrZmPtNvLcJRS++CcZWY8LT6KcoBZw@mail.gmail.com --- src/bin/initdb/initdb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c index 2b868511c5..3c1cf78b4f 100644 --- a/src/bin/initdb/initdb.c +++ b/src/bin/initdb/initdb.c @@ -3239,6 +3239,9 @@ main(int argc, char *argv[]) /* ... and tag on pg_ctl instead */ join_path_components(pg_ctl_path, pg_ctl_path, "pg_ctl"); + /* Convert the path to use native separators */ + make_native_path(pg_ctl_path); + /* path to pg_ctl, properly quoted */ appendShellString(start_db_cmd, pg_ctl_path);