有几种方法:
1、通过pg_controldata输出,主库Database cluster state,为in production, 备库为in archive recovery。
主库:
#/u01/pgsql/bin/pg_controldata -D/data
pg_control version number: 1100
Catalog version number: 201809051
Database system identifier: 6823651405425741880
Database cluster state: in production
pg_control last modified: Thu 07 May 2020 03:22:15 PM CST
Latest checkpoint location: 1/13001610
Latest checkpoint's REDO location: 1/130015D8
Latest checkpoint's REDO WAL file: 000000050000000100000013
备库:
#/u01/pgsql/bin/pg_controldata -D/data
pg_control version number: 1100
Catalog version number: 201809051
Database system identifier: 6823651405425741880
Database cluster state: in archive recovery
pg_control last modified: