-
Notifications
You must be signed in to change notification settings - Fork 181
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 are not supported because it's not a valid URI #387
Comments
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Sep 13, 2021
Unfortunately the uri gem from stdlib isn't compatible with postgresql://host1:port1,host2:port2 syntax. Therefore we introduce an extended regexp for parsing the URI. Previously we allowed changes to the URI by overwriting URI parts with hash values. This is no longer possible and this is a specification change. But I think it's bad practice and a questionable feature. Now only additions to the passed URI or connection string are possible. That way hostaddr and fallback_application_name are automatically appended. This patch also expands address resolution for multiple hosts. Fixes ged#387
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Sep 13, 2021
Unfortunately the uri gem from stdlib isn't compatible with postgresql://host1:port1,host2:port2 syntax. Therefore we introduce an extended regexp for parsing the URI. Previously we allowed changes to the URI by overwriting URI parts with hash values. This is no longer possible and this is a specification change. But I think it's bad practice and a questionable feature. Now only additions to the passed URI or connection string are possible. That way hostaddr and fallback_application_name are automatically appended. This patch also expands address resolution for multiple hosts. Fixes ged#387
larskanis
added a commit
to larskanis/ruby-pg
that referenced
this issue
Sep 13, 2021
Unfortunately the uri gem from stdlib isn't compatible with postgresql://host1:port1,host2:port2 syntax. Therefore we introduce an extended regexp for parsing the URI. Previously we allowed changes to the URI by overwriting URI parts with hash values. This is no longer possible and this is a specification change. But I think it's bad practice and a questionable feature. Now only additions to the passed URI or connection string are possible. That way hostaddr and fallback_application_name are automatically appended. This patch also expands address resolution for multiple hosts. Fixes ged#387
I overhauled the connection option builder as part of #397, so that it is possible to specify multiple hosts. The URI is no longer changed by the option hash, but we still extend it with |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hello,
Multiple hosts, as documented by 33.1.1.3. Specifying Multiple Hosts, is not supported because the gem attempts to parse and re-stringify the URL before giving it to
PQconnectdb
.Instead I think it should just pass the connection string as-is to
PQconnectdb
since that function is able to handle all the options and would give an error if the URI is not valid.Thank you.
The text was updated successfully, but these errors were encountered: