How to check whether the replication is configured or not in PostgreSQL DB-Server?

How to check whether the replication is configured or not in PostgreSQL DB-Server?

For Version 10 or above:

On master node:
Run the following command in psql shell:

      select client_addr, state, sent_lsn, write_lsn, flush_lsn, replay_lsn from pg_stat_replication;

Output:
If it displays "empty-set" --> replication is not configured properly
If replication slave details are listed --> replication is configured properly


For Version below 10:

On master node:
Run the following command in psql shell:

      select client_addr, state, sent_location, write_location,flush_location, replay_location from pg_stat_replication;

Output:
If it displays "empty-set" --> replication is not configured properly
If replication slave details are listed --> replication is configured properly

                  New to ADSelfService Plus?