Opened 16 years ago

Closed 16 years ago

#7699 closed (duplicate)

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

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

Description (last modified by Ramiro Morales)

File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", 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();
                       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;
 server_version
----------------
 8.3.3
(1 row)

Change History (2)

comment:1 by Ramiro Morales, 16 years ago

Description: modified (diff)

comment:2 by Karen Tracey <kmtracey@…>, 16 years ago

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