Opened 16 years ago

Last modified 16 years ago

#7699 closed

postgresql8.3 on window "select version()" format — at Initial Version

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

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 (0)

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