Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Multiple hosts and ports in DSN string #7

Open
roquie opened this issue May 19, 2020 · 1 comment
Open

Multiple hosts and ports in DSN string #7

roquie opened this issue May 19, 2020 · 1 comment
Labels
enhancement New feature or request

Comments

@roquie
Copy link

roquie commented May 19, 2020

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 :)

@kelunik kelunik added the enhancement New feature or request label May 19, 2020
@kelunik
Copy link
Member

kelunik commented May 19, 2020

You can already achieve something similar if you use DNS and provide multiple IPs there, as Amp will automatically try the other IPs if the connection to the first IP fails.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

2 participants