You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
incorrect PostgreSQL version, failed to connect to PG10/Debian #250
If you built asyncpg locally, which version of Cython did you use?:
Can the issue be reproduced under both asyncio and uvloop?: not related to event loop
I experience an issue when trying to connect to my local postgresql cluster. The error is :
File "/home/ludo/.virtualenvs/pyvt/lib/python3.6/site-packages/asyncpg/serverversion.py", line 49, in <listcomp>
versions = [int(p) for p in parts][:3]
ValueError: invalid literal for int() with base 10: '1 (Debian 10'
PostgreSQL version given by the server itself :
[ludo@postgres] # select version();
version
---------------------------------------------------------------------------------------------------------
PostgreSQL 10.1 (Debian 10.1-3) on x86_64-pc-linux-gnu, compiled by gcc (Debian 7.2.0-19) 7.2.0, 64-bit
(1 ligne)
PostgreSQL was installed from the main debian repositories :
I looked into the code but failed to find where the version is fetched from PG.
The version_string received in the split_server_version_string function is equal to "10.1 (Debian 10.1-3)" but it should be only "10.1" according to the rest of the function.
It seems like this problem is now present in new/upgrades PostgreSQL databases on Heroku, so anyone running asyncpg on Heroku with a recent PostgreSQL version now needs to run asyncpg from master. It would be lovely to have a new release cut which includes this workaround.
Activity
Fix server version parsing when it contains trailing data
elprans commentedon Jan 31, 2018
Sigh, arguably it's a Debian bug. There's no good reason why they should adulterate the
PG_VERSIONrisking breakage like this. #251 has a workaround.ldgeo commentedon Jan 31, 2018
thanks for the quick fix.
For my understanding how do you retrieve the PG version ?
elprans commentedon Jan 31, 2018
The version is reported by the server when the connection is established via a
ParameterStatusprotocol message.Fix server version parsing when it contains trailing data
jodal commentedon Feb 14, 2018
It seems like this problem is now present in new/upgrades PostgreSQL databases on Heroku, so anyone running asyncpg on Heroku with a recent PostgreSQL version now needs to run asyncpg from master. It would be lovely to have a new release cut which includes this workaround.
Make Server Version Extraction More Flexible
Make Server Version Extraction More Flexible (#778)