Communication error while getting a tuple - Mailing list pgsql-odbc

From PG User
Subject Communication error while getting a tuple
Date
Msg-id CAB7tN8ajYz_qQ3WbM3g1ZVQR5NL5699CnpyQ4p8YL=wb_FNokQ@mail.gmail.com
Whole thread Raw
Responses Re: Communication error while getting a tuple  (Michael Paquier <michael.paquier@gmail.com>)
List pgsql-odbc
Hi All,
I am connecting to postgres cluster using ODBC postgres driver and I am getting error as 

Description: 'Communication error while getting a tuple; 

Error fetching next row' 

SQLState: 08S01(SQLSTATE_COMMUNICATION_LINK_FAILURE) 

What can be possible reason for the same?

I am using the following script to get the tuples:

import pyodbc

cnxn = pyodbc.connect('DRIVER={PostgreSQL UNICODE};SERVER=hostname;DATABASE=testdb;PORT=port;UID=test;PWD=password;UseDeclareFetch=1;Fetch=999;sslmode=prefer')

cursor = cnxn.cursor()
cursor.execute(sql)
ressize=0
while(True):
  rows=cursor.fetchmany(999)

  sz=len(rows)
  ressize=ressize+sz

  if sz == 0:
    break;
  print "read =" + str(ressize)

The result size for a query is huge around 10M rows.

Thanking you.

- pguser
 

pgsql-odbc by date:

Previous
From: Barry Bell
Date:
Subject: Re: FW: ODBC 9.3.0210 not commiting, Discard ALL
Next
From: Michael Paquier
Date:
Subject: Re: Communication error while getting a tuple