Re: [HACKERS] backend -> interface communication

From: Hankin <hankin(at)dunno(dot)com>
To: Peter T Mount <psqlhack(at)maidast(dot)demon(dot)co(dot)uk>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: [HACKERS] backend -> interface communication
Date: 1998-03-03 07:26:01
Message-ID: 34FBB089.9A178D09@dunno.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Peter T Mount wrote:
>
> On Tue, 3 Mar 1998, Hankin wrote:
>
> > how is a notice sent from the backend?
> > does it send a Nxxxxx\n or a VNxxxxx\n ??
> >
> > Whenever I do a lo_close() I get a NOTICE: tablerelease: no lock found.
> > and PQfn() tries to read a VNxxxxx\n when the backend sends a Nxxxxx\n
>
> This last bit sounds familiar. I thought it was fixed a long time ago
> (after I noticed it while implementing PQfn in Java)

here's a program that duplicates it on my computer...

#include <libpq-fe.h>
#include <libpq/libpq-fs.h>

main()
{
PGconn *connection;
PGresult *result;
Oid oid;
int handle;
char buf[1024];

memset(buf,-1,sizeof(buf));

connection=PQsetdb(NULL,NULL,NULL,NULL,NULL);
if(connection==NULL) { exit(-1); }
PQtrace(connection,stderr);
oid=lo_creat(connection,INV_WRITE);
fprintf(stderr,"lo_creat: %s\n",PQerrorMessage(connection));
handle=lo_open(connection,oid,INV_WRITE);
fprintf(stderr,"lo_open: %s\n",PQerrorMessage(connection));
lo_write(connection,handle,buf,sizeof(buf));
fprintf(stderr,"lo_write: %s\n",PQerrorMessage(connection));
lo_write(connection,handle,buf,sizeof(buf));
fprintf(stderr,"lo_write: %s\n",PQerrorMessage(connection));
lo_close(connection,handle);
fprintf(stderr,"lo_close: %s\n",PQerrorMessage(connection));
result=PQexec(connection,"select aaa from test");
if(result==NULL || PQresultStatus(result)!=PGRES_TUPLES_OK) {
fprintf(stderr,"fail: %s\n",PQerrorMessage(connection)); }
PQfinish(connection);
}

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Martin 1998-03-03 10:32:40 Re: [HACKERS] PostgreSQL - the Linux of Databases...
Previous Message Peter T Mount 1998-03-03 06:36:51 Re: [HACKERS] backend -> interface communication