Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Multiple hosts and ports in DSN string #7

@roquie

Description

@roquie

Hi!

I think, supports of multiple host components is an important feature. Because database may be connected to master and slaves servers.

https://www.postgresql.org/docs/12/libpq-connect.html#LIBPQ-CONNSTRING

It is possible to specify multiple host components, each with an optional port component, in a single URI. A URI of the form postgresql://host1:port1,host2:port2,host3:port3/ is equivalent to a connection string of the form host=host1,host2,host3 port=port1,port2,port3. Each host will be tried in turn until a connection is successfully established.

In future I'll maybe create a Pull Request, but for now issue should be created as reminder :)

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions