DB Internals AtlasPostgreSQL 18.6 Home About

Parameter · Replication / Standby Servers

primary_conninfo

Sets the connection string to be used to connect to the sending server.

  • Default: '' (empty)
  • Type: string
  • Applies: Reload

In plain words

Tells a standby how to reach its primary (or an upstream standby): host, port, user, and so on. The standby's WAL receiver uses it to open a replication connection and stream WAL as it is written. Without it, a standby can only follow by reading archived WAL files.

For DBAs and operators

A libpq connection string, e.g. 'host=pg1 port=5432 user=replicator application_name=s1 sslmode=verify-full'. pg_basebackup -R writes one into postgresql.auto.conf together with standby.signal. Only used in standby mode. Changeable with a reload since PostgreSQL 13 (the WAL receiver restarts).

  • application_name is the name matched by synchronous_standby_names.
  • Keep passwords out of it: use ~/.pgpass (passfile) or certificates.
  • The role needs the REPLICATION attribute and a replication line in the primary's pg_hba.conf.
  • sync_replication_slots requires a dbname in it.

LOG: started streaming WAL from primary at 0/3000000 on timeline 1

On failure the WAL receiver logs e.g. FATAL: streaming replication receiver "s1" could not connect to the primary server: … and the startup process retries archive/pg_wal/stream every wal_retrieve_retry_interval. Check pg_stat_wal_receiver (status, sender_host, conninfo with password hidden).

How to change it

Change in postgresql.conf or ALTER SYSTEM, then run SELECT pg_reload_conf().

See it in context

WAL receiver Streaming replication Startup process

Related parameters

primary_slot_name synchronous_standby_names wal_receiver_timeout wal_retrieve_retry_interval restore_command

All Replication parameters