-
Notifications
You must be signed in to change notification settings - Fork 35
Trap Version Parsing Errors (ValueError on connect) #109
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
Comments
We have found this ValueError when connecting to older PostgreSQL instances also |
It's only particular builds of PostgreSQL. Specifically, debian/ubuntu packages have chosen to modify the server_version issued to the client in a way that would (likely) break any driver/application that is splitting/parsing the string. This is inconsistent with the source releases made by postgresql.org and is not a modification that clients/applications can/would/should anticipate. |
Yeah we are seeing this on an old postgres that has server version = I have a fix locally for that one module versionstring if you want it? Might not be too clever just an if statement to check the length of the expected version string. |
I think they've released builds like this for some time. It is a known incompatibility. The change that I will be committing regarding the issue will allow users to compensate by explicitly stating the server version. This is preferable as it allows for compensation of any variation, which is useful beyond one errant build. |
Hi, I was just wondering if there was any movement on this? I am using the Postgres docker container and it is setting my I like your thoughts around passing in the version instead of trying to derive it and was wondering if there was an ETA or if I should attempt to patch this in for the time being? |
My desire to implement this has stalled as the effect of the incompatibility has been present for so long. Either the driver has been patched locally already or it's not being used to connect to instances of those builds. Also, I'm not optimistic that a server version override is actually superior to runtime patching the version string parser. The latter being a solution that is already available to users. |
Can we have a sane default version in the cases where the version string cannot be parsed and a user warning ? |
Just ran into this using the postgres docker image from Docker hub: https://hub.docker.com/_/postgres This is what I'm using as a runtime patch to work-around it:
|
When connecting to servers that are not actually PostgreSQL, trap version parsing exceptions and issue a client warning instead.
Given the presence of a new
server_version
client parameter, use it instead of the version presented by the server averting the warning.The text was updated successfully, but these errors were encountered: