Receiving SIGPIPE for PQfinish() - Mailing list pgsql-interfaces

From Volkan YAZICI
Subject Receiving SIGPIPE for PQfinish()
Date
Msg-id 20060312112803.GA490@alamut
Whole thread Raw
Responses Re: Receiving SIGPIPE for PQfinish()  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-interfaces
Hi,

I've a problem when calling PQfinish() on a broken connection.
 Breakpoint 1, main () at finish.c:9 9               PGconn  *conn = PQconnectdb("dbname=test"); (gdb) n 11
if (PQstatus(conn) != CONNECTION_OK) (gdb) n 18              PQfinish(conn);
 

Shutting down postmaster in here (or restarting on another port).
 (gdb) n  Program received signal SIGPIPE, Broken pipe. 0xffffe410 in ?? () (gdb) bt #0  0xffffe410 in ?? () #1
0xbfafd368in ?? () #2  0xb7fe8308 in ?? () from ../usr/lib/libpq.so.4 #3  0xbfafd340 in ?? () #4  0xb7f68321 in send ()
from/lib/libc.so.6 #5  0xb7fe24a3 in pqsecure_write (conn=0xffffffe0, ptr=0xffffffe0, len=4294967264) at
fe-secure.c:480#6  0xb7fdbc9a in pqSendSome (conn=0x804a008, len=5) at fe-misc.c:757 #7  0xb7fd5448 in closePGconn
(conn=0x804a008)at fe-connect.c:1973 #8  0xb7fd5475 in PQfinish (conn=0x804a008) at fe-connect.c:2033 #9  0x080485f1 in
main() at finish.c:18
 

Should I handle SIGPIPE each time I call PQfinish() manually or should
PQfinish() be responsible for this task?


Regards.


pgsql-interfaces by date:

Previous
From: setyawankim
Date:
Subject: unsubscribe
Next
From: Tom Lane
Date:
Subject: Re: Receiving SIGPIPE for PQfinish()