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

Cannot connect to Postgres 14.2 on Ubuntu #118

Closed
zx80 opened this issue Mar 5, 2022 · 1 comment
Closed

Cannot connect to Postgres 14.2 on Ubuntu #118

zx80 opened this issue Mar 5, 2022 · 1 comment

Comments

@zx80
Copy link

zx80 commented Mar 5, 2022

On my Ubuntu 20.4 with Postgres 14.2 installed:

import postgresql.driver.dbapi20 as pg
c = pg.connect(database="tests", unix="/var/run/postgresql/.s.PGSQL.5432", host=None, port=None)

Results in:

ValueError: invalid literal for int() with base 10: '2 (Ubuntu 14'

Its seems that the driver is attempting to parse part of postgres version
PostgreSQL 14.2 (Ubuntu 14.2-1.pgdg20.04+1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 9.3.0-17ubuntu1~20.04) 9.3.0, 64-bit as an integer.

@jwp
Copy link
Contributor

jwp commented Mar 12, 2022

The build of PostgreSQL that you are connecting to has modified the version string. You can resolve this problem by using a build of PostgreSQL that does not modify the version string or by patching the client to accept the variation. The patch can either be at runtime (override the version parsing function before establishing connections) or by modifying the source directly.

@jwp jwp closed this as completed Mar 12, 2022
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

2 participants