Opened 9 years ago

Closed 9 years ago

#7699 closed (duplicate)

postgresql8.3 on window "select version()" format

Reported by: anonymous Owned by: nobody
Component: Database layer (models, ORM) Version: master
Severity: Keywords:
Cc: Triage Stage: Unreviewed
Has patch: no Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: UI/UX:

Description (last modified by Ramiro Morales)

File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\", line 57, in cursor
    postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
ValueError: invalid literal for int() with base 10: '3,'

because "select version()" returns:

testdb=# select version();
 PostgreSQL 8.3.3, compiled by Visual C++ build 1400
(1 row)

i think the best way is use PQparameterStatus() or PQserverVersion(), but psycopg2 not implement them.

other way is use "show server_version" insted of "select version()".

testdb=# show server_version;
(1 row)

Change History (2)

comment:1 Changed 9 years ago by Ramiro Morales

Description: modified (diff)

comment:2 Changed 9 years ago by Karen Tracey <kmtracey@…>

Resolution: duplicate
Status: newclosed

You've set version to SVN but this has already bee fixed: see #7090 and #6433, fixed in r7415. The code you cite is not present in the current version from SVN.

Note: See TracTickets for help on using tickets.
Back to Top