SQL function which allows to distinguish a server being in point in time recovery mode and an ordinary replica

From: m(dot)litsarev(at)postgrespro(dot)ru
To: pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: SQL function which allows to distinguish a server being in point in time recovery mode and an ordinary replica
Date: 2024-03-26 14:28:01
Message-ID: 06c02ef916d85e77778e5cdfdf67a3df@postgrespro.ru
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

At present time, an existing pg_is_in_recovery() method is not enough
to distinguish a server being in point in time recovery (PITR) mode and
an ordinary replica
because it returns true in both cases.

That is why pg_is_standby_requested() function introduced in attached
patch might help.
It reports whether a standby.signal file was found in the data directory
at startup process.
Instructions for reproducing the possible use case are also attached.

Hope it will be usefull.

Respectfully,

Mikhail Litsarev
Postgres Professional: https://postgrespro.com

Attachment Content-Type Size
use_case_pitr.txt text/plain 1.9 KB
v1-0001-Standby-mode-requested.patch text/x-diff 7.2 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2024-03-26 14:35:43 Re: Regression tests fail with musl libc because libpq.so can't be loaded
Previous Message Tristan Partin 2024-03-26 14:26:08 Re: make dist using git archive