From: Volkan YAZICI <yazicivo@ttnet.net.tr>
To: pgsql-interfaces@postgresql.org
Subject: Receiving SIGPIPE for PQfinish(<broken-connection>)
Date: Sun, 12 Mar 2006 13:28:03 +0200
Message-ID: <20060312112803.GA490@alamut> (raw)
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 0xbfafd368 in ?? ()
#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.
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-interfaces@postgresql.org
Cc: yazicivo@ttnet.net.tr
Subject: Re: Receiving SIGPIPE for PQfinish(<broken-connection>)
In-Reply-To: <20060312112803.GA490@alamut>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox