From: | Seva Zaslavsky <szaslavsky(at)mpcapitallp(dot)com> |
---|---|
To: | "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org |
Subject: | Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows |
Date: | 2025-06-13 14:51:14 |
Message-ID: | 076f46d6-edfd-44a0-b8a7-69ee0313a6f4@mpcapitallp.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-bugs |
Using the -l flag with "pg_ctl start" resolves this issue. This was a
significant behavior change since PG 13.18.
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.
On 6/13/2025 9:46 AM, David G. Johnston wrote:
> On Fri, Jun 13, 2025 at 6:34 AM PG Bug reporting form
> <noreply(at)postgresql(dot)org> wrote:
>
> The following bug has been logged on the website:
>
> Bug reference: 18958
> Logged by: Seva Zaslavsky
> Email address: szaslavsky(at)mpcapitallp(dot)com
> PostgreSQL version: 17.5
> Operating system: Windows Server 2019
> Description:
>
> J:\Users\Public\PostgreSQL\data>"c:\Program
> Files\PostgreSQL\17.5\bin\pg_ctl" start -D
> "J:\Users\Public\PostgreSQL\data\5438" -o "-p 5438"
> waiting for server to start....2025-06-13 08:44:06.019 EDT [10020]
> [] LOG:
> redirecting log output to logging collector process
> 2025-06-13 08:44:06.019 EDT [10020] [] HINT: Future log output
> will appear
> in directory "pg_log".
> done
> server started
>
>
> A bit surprising I suppose, but documented.
>
> """
> start mode launches a new server. The server is started in the
> background, and its standard input is attached to /dev/null (or nul on
> Windows). On Unix-like systems, by default, the server's standard
> output and standard error are sent to pg_ctl's standard output (not
> standard error). The standard output of pg_ctl should then be
> redirected to a file or piped to another process such as a log
> rotating program like rotatelogs; otherwise postgres will write its
> output to the controlling terminal (from the background) and will not
> leave the shell's process group. On Windows, by default the server's
> standard output and standard error are sent to the terminal. These
> default behaviors can be changed by using -l to append the server's
> output to a log file. Use of either -l or output redirection is
> recommended.
> """
>
> Note the final sentence, neither of which was done here.
>
> In short, while the server configuration stopped sending log data to
> stdout/stderr due to the log_collector directive pg_ctl has no
> awareness of that happening and so keeps itself attached to the
> process that launched it so the operator can see those streams.
>
> David J.
>
From | Date | Subject | |
---|---|---|---|
Next Message | David G. Johnston | 2025-06-13 14:58:05 | Re: BUG #18958: "pg_ctl start" allows subsequent CTRL-C key in cmd.exe to unexpectedly terminate cluster on Windows |
Previous Message | PG Bug reporting form | 2025-06-13 14:10:00 | BUG #18959: Name collisions of expression indexes during parallel Index creations on a pratitioned table. |