Lists: | pgsql-general |
---|
From: | Alex Sandini <asandini(at)keyware(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | use of PQconnectdb and PQfinish in a shared library |
Date: | 2002-10-28 10:59:04 |
Message-ID: | 3DBD1878.6060706@keyware.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
Hi all,
Using PQconnectdb and PQfinish each time a function is called from a
client, the function run well the first time is invoqued, but fails on
any subsequent call, at the first PQexec call, with respective kill -9
of the child process on the server.
To get it working, i've done something like:
static bool bfirsttime = false;
int4 any_function (text buf, int4 num )
{
if( !bfirsttime ) {
dbconn = PQconnectdb( conninfo );
bfirsttime = true;
}
/* code... */
/* dont close db in library */
/* PQfinish( dbconn ); */
return( 0 );
}
Hum, the connection is never closed, it should be possible to do it in a
cleaner way...
Any hint?
Thx,
Alex
From: | asandini(at)keyware(dot)com |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | cancel <3DBD1878.6060706@keyware.com> |
Date: | 2002-10-28 13:31:51 |
Message-ID: | 3dbd3c46$0$12229$4d4efb8e@news.be.uu.net |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Lists: | pgsql-general |
This message was cancelled from within Mozilla.