Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-hackers by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group