Use native path separators to pg_ctl in initdb
authorAlvaro Herrera
Tue, 2 Mar 2021 18:39:34 +0000 (15:39 -0300)
committerAlvaro Herrera
Tue, 2 Mar 2021 18:39:34 +0000 (15:39 -0300)
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

index eb75a72793a44edd245f5e826b00da2ffb9e734f..291078a1756e69c303228d3d20f4a57c53d56849 100644 (file)
@@ -3281,6 +3281,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);