Skip to content

Multihost connect strings in PostgreSQL #314

@xluffy

Description

@xluffy

target_session_attrs

This option determines whether the session must have certain properties to be acceptable. It's typically used in combination with multiple host names to select the first acceptable alternative among several hosts. There are six modes:

  • any (default): any successful connection is acceptable
  • read-write: session must accept read-write transactions by default (that is, the server must not be in hot standby mode and the default_transaction_read_only parameter must be off)
  • read-only: session must not accept read-write transactions by default (the converse)
  • primary: server must not be in hot standby mode
  • standby: server must be in hot standby mode
  • prefer-standby: first try to find a standby server, but if none of the listed hosts is a standby server, try again in any mode

https://www.cybertec-postgresql.com/en/postgresql-high-availability-architectures/

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions