Re: libpq object hooks

Поиск
Список
Период
Сортировка
От Andrew Chernow
Тема Re: libpq object hooks
Дата
Msg-id 482DD3AC.9020207@esilo.com
обсуждение исходный текст
Ответ на Re: libpq object hooks  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: libpq object hooks  ("Merlin Moncure" <mmoncure@gmail.com>)
Список pgsql-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/

В списке pgsql-patches по дате отправления:

Предыдущее
От: Magnus Hagander
Дата:
Сообщение: Re: libpq thread-locking
Следующее
От: Oleg Bartunov
Дата:
Сообщение: Re: Partial match in GIN (next vesrion)