Changes between Initial Version and Version 1 of Ticket #7699


Ignore:
Timestamp:
Jul 10, 2008, 4:47:10 AM (16 years ago)
Author:
Ramiro Morales
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #7699 – Description

    initial v1  
    1    File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 57, in cursor
    2      postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
    3  ValueError: invalid literal for int() with base 10: '3,'
    4 
     1{{{
     2File "C:\Python25\Lib\site-packages\django\db\backends\postgresql_psycopg2\base.py", line 57, in cursor
     3    postgres_version = [int(val) for val in cursor.fetchone()[0].split()[1].split('.')]
     4ValueError: invalid literal for int() with base 10: '3,'
     5}}}
    56because "select version()" returns:
    6  testdb=# select version();
    7                         version
    8  -----------------------------------------------------
    9   PostgreSQL 8.3.3, compiled by Visual C++ build 1400
    10  (1 row)
    11 
    12 i think the best way is use PQparameterStatus() or PQserverVersion(),
    13 but psycopg2 not implement them.
     7{{{
     8testdb=# select version();
     9                       version
     10-----------------------------------------------------
     11 PostgreSQL 8.3.3, compiled by Visual C++ build 1400
     12(1 row)
     13}}}
     14i think the best way is use PQparameterStatus() or PQserverVersion(), but psycopg2 not implement them.
    1415
    1516other way is use "show server_version" insted of "select version()".
    16  testdb=# show server_version;
    17   server_version
    18  ----------------
    19   8.3.3
    20  (1 row)
    21 
     17{{{
     18testdb=# show server_version;
     19 server_version
     20----------------
     21 8.3.3
     22(1 row)
     23}}}
Back to Top