Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows - Mailing list pgsql-bugs

From Seva Zaslavsky
Subject Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows
Date
Msg-id b5ccf81a-f521-4626-a23b-32d8a7264abe@mpcapitallp.com
Whole thread Raw
In response to Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-bugs

All of the behavior I've described in the original bug post regarding CTRL-C terminating the cluster is present in 13.18 - hence contrary to what I asserted earlier, there is no "significant behavior change since PG 13.18."

However, the pg_ctl start "--log=filename" option only affects stdout and stderr.  

I'm still observing the behavior that pressing CTRL-C inside cmd.exe terminates the cluster that was started inside that cmd.exe.

According to the documentation for pg_ctl "The server is started in the background, and its standard input is attached to /dev/null (or nul on Windows)." but if pressing CTRL-C in a cmd.exe window terminates the cluster that was started inside that cmd.exe window, doesn't it seem like stdin is attached to the output cmd.exe and not to NUL?

Is it the expected behavior that pressing CTRL-C will terminate the cluster that was started inside that cmd.exe on windows?

On 6/13/2025 10:58 AM, David G. Johnston wrote:
On Fri, Jun 13, 2025 at 7:51 AM Seva Zaslavsky <szaslavsky@mpcapitallp.com> wrote:

Using the -l flag with "pg_ctl start"  resolves this issue.  This was a significant behavior change since PG 13.18.


I don't recall this changing recently...the documentation hasn't at least...

David - Thank you for the quick response.  Would appreciate if you have any thoughts on another logging bug (or behavior change since PG 13.18) that I documented on June 11 in #18955.

That seems Windows OS specific which I'm unable to review and comment upon.

David J.

pgsql-bugs by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows
Next
From: "David G. Johnston"
Date:
Subject: Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows