This project is archived and is in readonly mode.

#156 ✓invalid
Psycopg website

Still issuing a SHOW

Reported by Psycopg website | April 17th, 2013 @ 09:36 PM

Submitted by: Nathen Hinson


Although in a discussion of the changes in psycopg 2.4.6 mentions that the default behavior of the adapter will no longer issue:
SHOW client_encoding
SHOW default_transaction_isolation

it appears that from a fresh compile from source of 2.4.6 targeting Postgres 8.2.20 server the library still issues the "SHOW default_transaction_isolation".

Is this correct behavior? If so would you entertain modifications to that so the connection doesn't ask for the transaction level, perhaps only doing so prior to an explicit SET of the transaction isolation level?

Thanks very much!

Nathen Hinson

Comments and changes to this ticket

  • Daniele Varrazzo

    Daniele Varrazzo April 17th, 2013 @ 10:41 PM

    • State changed from “new” to “invalid”

    psycopg 2.4.6 issues SHOW default_transaction_isolation only when asked for conn.isolation_level. If the property is not read the query is not performed.

    $ PSYCOPG_DEBUG=1 ipython
    Python 2.7.3 (default, Aug  1 2012, 05:16:07) 
    In [1]: import psycopg2
    [334] initpsycopg: initializing psycopg 2.5 (dt dec mx pq3 ext)
    In [2]: cnn = psycopg2.connect('')
    [334] psyco_connect: dsn = '', async = 0
    [334] connection_setup: init connection object at 0xb6b79f5c, async 0, refcnt = 1
    [334] con_connect: connecting in SYNC mode
    [334] conn_connect: new postgresql connection at 0x9c16bb8
    [334] conn_connect: server standard_conforming_strings parameter: on
    [334] conn_connect: server requires E'' quotes: NO
    [334] conn_connect: using protocol 3
    [334] conn_connect: client encoding: UTF8
    [334] clear_encoding_name: UTF8 -> UTF8
    [334] conn_connect: DateStyle ISO, DMY
    [334] connection_setup: good connection object at 0xb6b79f5c, refcnt = 1
    In [3]: cnn.isolation_level
    [334] pq_get_guc_locked: reading default_transaction_isolation
    [334] pq_get_guc_locked: pgconn = 0x9c16bb8, query = SHOW default_transaction_isolation
    Out[3]: 1
  • Nathen Hinson

    Nathen Hinson April 18th, 2013 @ 02:52 PM

    Hi Daniele,

    Thank-you for the speedy investigation and for the clarification on behavior. In the future I will vet any "issues" through the mailing list prior to submitting them here.


    Nathen Hinson

Create your profile

Help contribute to this project by taking a few moments to create your personal profile. Create your profile ยป

<b>WARNING:</b> the informations in this tracker are archived. Please submit new tickets or comments to <a href="">the new tracker</a>.
Psycopg is the most used PostgreSQL adapter for the Python programming language. At the core it fully implements the Python DB API 2.0 specifications. Several extensions allow access to many of the features offered by PostgreSQL.

Shared Ticket Bins