On Fri, Sep 24, 2021, at 1:46 PM, Bharath Rupireddy wrote:
I'm trying to set up a postgres server with version 11 in targeted
recovery mode (for the first time after my journey started with
postgres) and I came across the explanation at [1] in PG 12 and newer
versions that we have a clear differentiation as to what is the
"standby" mode or "targeted recovery" mode. How do we differentiate
these two modes in PG 11? Can anyone please help me with it?
It seems you have to rely on parsing recovery.conf. However, someone can modify
it after starting Postgres. In this case, you have to use a debugger such as
gdb /path/to/postgres -p $(pgrep -f 'postgres: startup recovering') -quiet -batch -ex 'p StandbyMode' -ex 'quit'
Unfortunately, there is no simple way such as checking if a .signal file exists.