Re: how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11? - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11?
Date
Msg-id 5b9509fb-e07b-4e99-97fe-8d1a5f24e4f6@www.fastmail.com
Whole thread Raw
In response to how to distinguish between using the server as a standby or for executing a targeted recovery in PG 11?  (Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>)
List pgsql-hackers
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.


--
Euler Taveira

pgsql-hackers by date:

Previous
From: Bruce Momjian
Date:
Subject: Re: storing an explicit nonce
Next
From: Alvaro Herrera
Date:
Subject: Re: typos (and more)