Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: pg_ctl start may return 0 even if the postmaster has been already started on Windows
Date
Msg-id ZPl9pAlFaGxhCQqw@paquier.xyz
Whole thread Raw
In response to pg_ctl start may return 0 even if the postmaster has been already started on Windows  ("Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>)
Responses RE: pg_ctl start may return 0 even if the postmaster has been already started on Windows
List pgsql-hackers
On Thu, Sep 07, 2023 at 07:07:36AM +0000, Hayato Kuroda (Fujitsu) wrote:
> # Problem
>
> The "pg_ctl start" command returns 0 (succeeded) even if the cluster has
> already been started. This occurs on Windows environment, and when the command
> is executed just after postmaster starts.

Not failing on `pg_ctl start` if the command is run on a data folder
that has already been started previously by a different command with a
postmaster still alive feels like cheating, because pg_ctl is lying
about its result.  If pg_ctl wants to start a cluster but is not able
to do it, either because the postmaster failed at startup or because
the cluster has already started, it should report a failure.  Now, I
also recall that the processes spawned by pg_ctl on Windows make the
status handling rather tricky to reason about..
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Ashutosh Sharma
Date:
Subject: Re: Can a role have indirect ADMIN OPTION on another role?
Next
From: Michael Paquier
Date:
Subject: Re: persist logical slots to disk during shutdown checkpoint