Why PostgreSQL does not display the correct synchronization status
Issue
-
An issue was found while configuring synchronous replication for PostgreSQL. The
primary_conninfoparameter has been configured in thepostgresql.conffile of the standby server, and the valueapplication_namespecified in the parameter is consistent with thesynchronous_standby_namessetting of the primary server. -
However, after the configuration is completed, it is confirmed through the
pg_stat_replicationview that theapplication_namedoes not display the value specified byprimary_conninfoas expected, but instead displays the default value of 'walreceiver'. Thesync_stateis also displayed as 'async', rather than the expected 'sync'. -
Results on primary server side:
postgres=# select usename,application_name,state,sync_state from pg_stat_replication;
usename | application_name | state | sync_state
---------+------------------+-----------+------------
replhr | walreceiver | streaming | async
(1 row)
Environment
- Red Hat Enterprise Linux
- PostgreSQL12
Subscriber exclusive content
A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.