primary_conninfo
primary_conninfo
is a configuration parameter specifying the upstream server for a streaming replication standby to connect to.
Note that despite what the name implies, since the introduction of cascading replication in PostgreSQL 9.2, the specified server can be another standby.
primary_conninfo
was added in PostgreSQL 9.0.
Default value
The default value for primary_conninfo
is: ''
(empty string).
Usage
Current setting
The current setting for primary_conninfo
(as used by the walreceiver) is contained in the conninfo
column of the system view pg_stat_wal_receiver
(PostgreSQL 9.6 and later). Note however that the conninfo
column will also contain any libpq
default conninfo
parameters.
Validity on a primary server
It is possible to set primary_conninfo
on a primary server (i.e. a server which is not in recovery), but it will have no effect.
Note that following promotion of a standby server to primary, the server's primary_conninfo
will not be reset, though it will not be used as long as the server is a primary.
PostgreSQL 13 and later
In PostgreSQL 13 and later, primary_conninfo
is handled as a normal GUC and can be set in postgresql.conf
or modified via ALTER SYSTEM
. A change requires a configuration reload to take effect.
PostgreSQL 12
In PostgreSQL 12, primary_conninfo
is handled as a normal GUC and can be set in postgresql.conf
or modified via ALTER SYSTEM
. A change requires a restart of the PostgreSQL instance to take effect.
PostgreSQL 11 and earlier
In PostgreSQL 11 and earlier, primary_conninfo
is specified in recovery.conf; a change requires a restart of the PostgreSQL instance to take effect.
Change history
- PostgreSQL 13
primary_conninfo
can now be changed with a configuration reload (commit 1e614803)
- PostgreSQL 12
- PostgreSQL 9.0
- added (commit 40f908bd)
References
- PostgreSQL documentation: primary_conninfo
- PostgreSQL 11 documentation: primary_conninfo