Thread: Communication error while getting a tuple
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
On Wed, Apr 2, 2014 at 1:13 PM, PG User <pguser1982@gmail.com> wrote: > SQLState: 08S01(SQLSTATE_COMMUNICATION_LINK_FAILURE) > What can be possible reason for the same? Probably network problem, even hardware failure: http://social.msdn.microsoft.com/Forums/sqlserver/en-US/40eededa-752a-4445-8fa4-a023df69031f/sqlstate08501-or-communication-link-failure?forum=sqldataaccess You might even get that on a server facing a high load. -- Michael
Thank you for reply.
I tried many options and found that when I change from sslmode=prefer to sslmode=allow, I did not get any error.
Do you know the reason for the same?
Thanking you.
- Nachiket
On Tue, Apr 1, 2014 at 9:38 PM, Michael Paquier <michael.paquier@gmail.com> wrote:
On Wed, Apr 2, 2014 at 1:13 PM, PG User <pguser1982@gmail.com> wrote:Probably network problem, even hardware failure:
> SQLState: 08S01(SQLSTATE_COMMUNICATION_LINK_FAILURE)
> What can be possible reason for the same?
http://social.msdn.microsoft.com/Forums/sqlserver/en-US/40eededa-752a-4445-8fa4-a023df69031f/sqlstate08501-or-communication-link-failure?forum=sqldataaccess
You might even get that on a server facing a high load.
--
Michael