target_session_attrs

libpq connection parameter to specify whether a connection must be a primary

target_session_attrs is a libpq connection parameter to specify whether a connection can be to a read-only standby server. It is intended for use in combination with the host parameter, when specifying multiple hosts to connect to.

Possible values are:

  • any
  • read-write

target_session_attrs was added in PostgreSQL 10 (commit 721f7bd3).

Categories

Database connections, Replication