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

Re: libpq object hooks

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Andrew Chernow <ac(at)esilo(dot)com>
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-15 18:44:14
Message-ID: 9867.1210877054@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-hackerspgsql-patches
Andrew Chernow <ac(at)esilo(dot)com> writes:
> Which callback do we use as the key?  Currently, none are required (only 
> the name was required).  We have to choose one callback that must be 
> provided.

What?  I thought what you wanted back was the void * pointer that had
been registered with a particular callback function.  So you use that
callback function.  If it's not actually registered, you get a NULL.

> This is what is passed to PQaddObjectHooks, along with a conn:

This is all wrong IMHO, not least because it creates ABI problems if you
want to add another hook type later.  Register each hook separately, eg

typedef void (*PGCRHook) (PGconn *conn, void *passthrough);

void PQregisterConnResetHook(PGconn *conn, PQCRHook func, void *passthrough);

... repeat for each possible hook ...

			regards, tom lane

In response to

Responses

pgsql-hackers by date

Next:From: pgsqlDate: 2008-05-15 18:57:58
Subject: SSL and USER_CERT_FILE patch
Previous:From: Andrew ChernowDate: 2008-05-15 18:36:42
Subject: Re: libpq object hooks

pgsql-patches by date

Next:From: Bruce MomjianDate: 2008-05-15 19:21:37
Subject: Re: Patch to change psql default banner v6
Previous:From: Alvaro HerreraDate: 2008-05-15 18:37:47
Subject: Re: Patch to change psql default banner v6

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