Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Support for multiple hosts #1470

Copy link
Copy link

Description

@vitaly-t
Issue body actions

PostgreSQL v10 was released on Oct 05, 2017, see the Release Notes.


One of the most interesting features that affects node-postgres is multiple host names or addresses in libpq connection strings and URIs.

This feature allows automatic support for replicas through the connection string, i.e. the first connection is tried, and if fails - the next one, and so on.

From documentation:

It is possible to specify multiple hosts to connect to, so that they are tried in the given order. In the Keyword/Value format, the host, hostaddr, and port options accept a comma-separated list of values. The same number of elements must be given in each option, such that e.g. the first hostaddr corresponds to the first host name, the second hostaddr corresponds to the second host name, and so forth. As an exception, if only one port is specified, it applies to all the hosts.

It may require some work within the driver to support it, but it will be very much worthwhile 😉

Reactions are currently unavailable

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

    Morty Proxy This is a proxified and sanitized view of the page, visit original site.