On 4/8/21, 2:58 AM, "Magnus Hagander" <magnus@hagander.net> wrote:
> Another option could be to provide a switch to the postmaster binary.
> Using pg_config as originally suggested is risky because you might
> pick up the wrong postmaster, but if you put it on the actual
> postmaster binary you certainly know which one you're on... As this is
> something that's primarily of interest to developers, it's also a bit
> lower weight than having a "heavy" solution like an entire mode for
> pg_ctl.
I was looking at the --check switch for the postgres binary recently
[0], and this sounds like something that might fit in nicely there.
In the attached patch, --check will also check the control file if one
exists.
Nathan
[0] https://postgr.es/m/0545F7B3-70C0-4DE8-8C85-EAFE6113B7EE%40amazon.com