Edgewall Software

Ticket #4732: pypgsql_cursor_fix.diff

File pypgsql_cursor_fix.diff, 625 bytes (added by Jeremy Kemper <jeremy@…>, 5 years ago)

disable server-side cursors when using pypgsql

  • postgres_backend.py

    old new  
    110110            cnx = psycopg.connect(' '.join(dsn)) 
    111111            cnx.set_client_encoding('UNICODE') 
    112112        else: 
     113            # Don't use chatty, inefficient server-side cursors. 
     114            # http://pypgsql.sourceforge.net/pypgsql-faq.html#id2787367 
     115            PgSQL.fetchReturnsList = 1 
     116            PgSQL.noPostgresCursor = 1 
    113117            cnx = PgSQL.connect('', user, password, host, path, port,  
    114118                                client_encoding='utf-8', unicode_results=True) 
    115119        try: