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

Re: libpq object hooks (libpq events)

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 (libpq events)
Date: 2008-05-20 03:03:48
Message-ID: 48323F94.6010201@esilo.com (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Tom Lane wrote:
> Andrew Chernow <ac(at)esilo(dot)com> writes:
>> 4. add a setter for result instance data
>>    - There should also be a PQsetInstanceData(PGconn*, ...)
>>    - I see no need for a passThrough setter
> 
> Check, though I assume we're not expecting PQsetInstanceData to
> propagate to previously created PGresults?
> 

No, not at all.  Already created results are on their own.  If you want to 
modify the instanceData, you can use PQresultSetInstanceData.

>> 5. move callback stuff to its own header, maybe pgcallback.h?
> 
> Should be libpq-something.  I was considering libpq-hooks.h or
> libpq-events.h, but libpq-callback.h would be OK too.
> 

I like events.  It sounds like you wanted PGCallback, although I am starting to 
think PGEventProc is better than PGcallback, only because it is more consistent 
with the term events.

BTW, my suggestion to call this libpq events was not directly referring to the 
callback/proc.  It was a term for describing the whole #!  I think the idea is 
to notify interested parties about libpq events, the callback is just an 
implementaion for doing that.

>> Adding PQresultSetInstanceData doesn't removes the need for a resultcreate 
>> callback event.
> 
> No, of course not.  What I was imagining was that the resultcreate
> callback would call PQresultSetInstanceData.
> 

Sorry, my mistake.  You were actually very clear, my reading skills are in question.


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

In response to

Responses

pgsql-hackers by date

Next:From: Tom LaneDate: 2008-05-20 03:31:29
Subject: Re: Link requirements creep
Previous:From: Merlin MoncureDate: 2008-05-20 02:53:23
Subject: Re: libpq object hooks (libpq events)

pgsql-patches by date

Next:From: Andrew ChernowDate: 2008-05-20 04:28:54
Subject: Re: libpq object hooks (libpq events)
Previous:From: Merlin MoncureDate: 2008-05-20 02:53:23
Subject: Re: libpq object hooks (libpq events)

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