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

Postgres: Support multiple endpoints #1717

Open
mxey opened this issue May 19, 2020 · 0 comments
Open

Postgres: Support multiple endpoints #1717

mxey opened this issue May 19, 2020 · 0 comments

Comments

@mxey
Copy link
Contributor

mxey commented May 19, 2020

The Postgres storage driver can only connect to a single host. It would be useful for clustering Postgres if it could pick the master among multiple hosts.

That is a limitation of the library lib/pq that is used in it. The library is in maintenance mode and this feature is unlikely to be added. They recommend https://github.com/jackc/pgx as a replacement.

pgx supports target_session_attrs, like libpq does:

target_session_attrs
If this parameter is set to read-write, only a connection in which read-write transactions are accepted by default is considered acceptable. The query SHOW transaction_read_only will be sent upon any successful connection; if it returns on, the connection will be closed. If multiple hosts were specified in the connection string, any remaining servers will be tried just as if the connection attempt had failed. The default value of this parameter, any, regards all connections as acceptable.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant