Why PostgreSQL does not display the correct synchronization status

Solution Verified - Updated -

Issue

  • An issue was found while configuring synchronous replication for PostgreSQL. The primary_conninfo parameter has been configured in the postgresql.conf file of the standby server, and the value application_name specified in the parameter is consistent with the synchronous_standby_names setting of the primary server.

  • However, after the configuration is completed, it is confirmed through the pg_stat_replication view that the application_name does not display the value specified by primary_conninfo as expected, but instead displays the default value of 'walreceiver'. The sync_state is 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.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content