On Windows, use COMSPEC to find the location of cmd.exe.
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 28 Oct 2019 18:15:03 +0000 (14:15 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 28 Oct 2019 18:15:03 +0000 (14:15 -0400)
commitf88544904e4b57b1a8e969a5d594288554417c88
tree5503dafca6829885f5b84a6bbbf95660bf7c8b91
parentbd1ef5799b04168d8a869197dd9b85935d5d5da9
On Windows, use COMSPEC to find the location of cmd.exe.

Historically, psql consulted COMSPEC to spawn a shell in its \! command,
but we just invoked "cmd" when spawning shells in pg_ctl and pg_regress.
It seems better to rely on the environment variable, if it's set,
in all cases.

It's debatable whether this is a bug fix or just a behavioral change,
so no back-patch.

Juan José Santamaría Flecha

Discussion: https://postgr.es/m/16080-5d7f03222469f717@postgresql.org
src/bin/pg_ctl/pg_ctl.c
src/test/regress/pg_regress.c