pg_is_in_recovery()

A system function for retrieving the recovery status of an instance

pg_is_in_recovery() is a system function for retrieving the recovery status of an instance.

pg_is_in_recovery() was added in PostgreSQL 9.0.

Usage

pg_is_in_recovery() → BOOLEAN

Change history

Examples

Basic usage:

postgres=# SELECT pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 t
(1 row)

postgres=# SELECT pg_promote();
 pg_promote 
------------
 t
(1 row)

postgres=# SELECT pg_is_in_recovery();
 pg_is_in_recovery 
-------------------
 f
(1 row)

Categories

Monitoring, Replication, System function

See also

in_hot_standby, pg_promote()