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

Re: libpq object hooks

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, "Patches (PostgreSQL)" <pgsql-patches(at)postgresql(dot)org>
Subject: Re: libpq object hooks
Date: 2008-05-16 18:34:20
Message-ID: 482DD3AC.9020207@esilo.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> 
> typedef void (*PGeventProc) (PGeventId eventId, const void *eventInfo,
>                              void *passthrough);
> 
> int PQregisterEventProc(PGconn *conn, PGeventProc proc, void *passthrough);
> 
> 
> 

The above prototypes will work and we will add our 'event instance 
pointer' to the event info structures.  Should have a patch shortly.

libpqtypes doesn't need a passthrough/user-pointer.  The object 
events/hooks allocate memory when the object is created "part of a 
conn/result object instance", it is not supplied by the API user 
registering the event/hook callback.

I think this is where some confusion has been occurring, there are two 
different pointers: user pointer and event instance pointer.

BTW, PQeventData and PQresultEventData return the event instance 
pointer, not the passthrough.  At least that is how we were using these 
functions, being how our previous patches do not include a 
passthrough/user-pointer feature because libpqtypes didn't need it.

-- 
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

In response to

Responses

pgsql-hackers by date

Next:From: Euler Taveira de OliveiraDate: 2008-05-16 18:54:30
Subject: Re: ecpg localization
Previous:From: Heikki LinnakangasDate: 2008-05-16 15:56:41
Subject: Re: Arbitary file size limit in twophase.c

pgsql-patches by date

Next:From: Oleg BartunovDate: 2008-05-16 18:37:27
Subject: Re: Partial match in GIN (next vesrion)
Previous:From: Magnus HaganderDate: 2008-05-16 18:31:03
Subject: Re: libpq thread-locking

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