error: message type 0x5a arrived from server while idle

Started by vyouzhiover 16 years ago3 messagesbugs
Jump to latest
#1vyouzhi
vyouzhi@gmail.com

hi all:

i use Python and PyGreSQL to link PostgreSQL
but the Python give me the error

the error here :
--------------------------------------------
...
95
93
95
97
94
96
94
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
INSERT INTO code (stock_name ,stock_code)values('bbbbb','bbbbb')

95
93
92
93
99
--------------------------------------------

and the PostgreSQL log error like here

-------------------------------------------
...
LOG: unexpected EOF on client connection
...
------------------------------------------

me python code_me.py

--------------------------------------------
#!/usr/bin/env python
#coding=utf-8
import _pg
import threading

con =
_pg.connect(host='127.0.0.1',user='work',dbname='work',passwd='123',port=5432)

def link_url():
global con
for i in range(100):
print i
stock_sql = "INSERT INTO code (stock_name
,stock_code)values('bbbbb','bbbbb')"
try:
con.query(stock_sql)
except:
print stock_sql

if __name__=='__main__':
for i in range(0,32):
print i
i = threading.Thread(target = link_url)
i.start()

-----------------------------------------------

who can help me ? thanks

#2Robert Haas
robertmhaas@gmail.com
In reply to: vyouzhi (#1)
Re: error: message type 0x5a arrived from server while idle

On Tue, Sep 8, 2009 at 11:38 PM, vyou zhi <vyouzhi@gmail.com> wrote:

hi all:

i use Python and PyGreSQL to link  PostgreSQL
but the Python give me the error

the error here :
--------------------------------------------
...
95
93
95
97
94
96
94
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle
INSERT INTO  code (stock_name ,stock_code)values('bbbbb','bbbbb')

95
93
92
93
99
--------------------------------------------

and the PostgreSQL log error like here

-------------------------------------------
...
LOG:  unexpected EOF on client connection

This sounds like a bug in PyGreSQL. Maybe it's not following the FE
protocol correctly?

...Robert

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Robert Haas (#2)
Re: error: message type 0x5a arrived from server while idle

Robert Haas <robertmhaas@gmail.com> writes:

On Tue, Sep 8, 2009 at 11:38 PM, vyou zhi <vyouzhi@gmail.com> wrote:

i use Python and PyGreSQL to link� PostgreSQL
but the Python give me the error
message type 0x43 arrived from server while idle
message type 0x5a arrived from server while idle

This sounds like a bug in PyGreSQL. Maybe it's not following the FE
protocol correctly?

I think this is a fairly common symptom of trying to use the same PG
connection in multiple threads ...

regards, tom lane