On 12/11/2026 02:05, Zsolt Parragi wrote:
Hello

An automated claude review pointed out an issue caused by 2e2751e6976:
it removed the SIGCHLD reset from PostgresMain(), but that code also
ran for standalone backends, which never call InitPostmasterChild().
postgres --single now keeps whatever SIGCHLD disposition it inherited,
and if that is SIG_IGN, pclose() fails:

     $ python3 -c 'import os,signal,sys; signal.signal(signal.SIGCHLD,
signal.SIG_IGN); os.execvp(sys.argv[1], sys.argv[1:])' \
         postgres --single -D data postgres
     backend> COPY (SELECT 1) TO PROGRAM 'cat > /dev/null';
     ERROR:  could not close pipe to external command: No child processes

The attached patch adds the same reset to InitStandaloneProcess().

Committed, thanks.

I keep forgetting about single-user mode. And it didn't occur to me that postgres might get launched with SIGCHLD ignored.

- Heikki



Reply via email to