Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows

Álvaro Herrera <alvherre@kurilemu.de>

From: Álvaro Herrera <alvherre@kurilemu.de>
To: Bryan Green <dbryan.green@gmail.com>
Cc: pgsql-hackers@lists.postgresql.org, Sutou Kouhei <kou@clear-code.com>, michael@paquier.xyz, robertmhaas@gmail.com, horikyota.ntt@gmail.com, kuroda.hayato@fujitsu.com, shlok.kyal.oss@gmail.com, tgl@sss.pgh.pa.us
Date: 2026-02-02T13:28:36Z
Lists: pgsql-hackers

Attachments

Hello,

Somebody seems to have trimmed the CC field upthread for no apparent
reason.  I put it back the way I think it was when that happened.

Here's a rebased version of this patch.  This is pretty much just
Bryan's patch, which I agree is a good way forward, though perhaps not
very backpatchable.  I suspect we need to consider this one for mastern
only, and use a less intrusive version for backpatching -- perhaps
Kyotaro's earlier version.

Regarding this patch, I haven't really reviewed it -- but I wonder why
we need two global variables to keep postmaster's PID: the newly
introduced pm_pid (which was previously a local variable only) and the
preexisting postmasterPID.  I suspect this needs to be cleaned up.

-- 
Álvaro Herrera        Breisgau, Deutschland  —  https://www.EnterpriseDB.com/
"Los minutos y los segundos son mercadería de la ciudad, donde un infeliz se
afana por no perder ni siquiera un segundo y no advierto que obrando de ese
modo pierde una vida."              ("La vuelta de Don Camilo", G. Guareschi)

Commits

  1. Re-enable autoruns for cmd.exe on Windows

  2. Re-enable autoruns for for cmd.exe on Windows

  3. pg_regress: Disable autoruns for cmd.exe on Windows

  4. pg_ctl: Disable autoruns for cmd.exe on Windows