Re: libpq object hooks (libpq events) - Mailing list pgsql-hackers

From Alvaro Herrera
Subject Re: libpq object hooks (libpq events)
Date
Msg-id 20080903165544.GA4114@alvh.no-ip.org
Whole thread Raw
In response to Re: libpq object hooks (libpq events)  (Andrew Chernow <ac@esilo.com>)
Responses Re: libpq object hooks (libpq events)  (Andrew Chernow <ac@esilo.com>)
List pgsql-hackers
Andrew Chernow escribió:
> Alvaro Herrera wrote:

>> (I also removed PQresultAlloc.)
>
> Nooooooo ... removing PQresultAlloc breaks libpqtypes!  It also removes 
> some of the use cases provided by PQsetvalue, which allows one to add to 
> a result (in our case from scratch).

I don't really see the point -- it's the same as pqResultAlloc, except
that you have to pass an extra argument.  There's no actual
functionality loss.

> > However, the only change of any significance that I introduced was that
> > a "name" is attached to every event proc, so that it can be reported in
> > error messages, as reporting only %p seems very useless.  (I also
> > removed PQresultAlloc.)
>
> I don't mind re-introducing the name, but Tom seemed very against this 
> due to conflicts.  If 2 different libraries register the same name, 
> debugging would be painful.

Hmm, is that really a good argument?  I don't see how providing a
pointer is a better answer than a name -- it's far less user friendly.
Let's start assuming that no duplicate names would be used, and if there
are any conflicts in the real world, we can just ask the user to fire up
GDB to figure out where each name is pointing to.  My guess is that
conflicting names will be a rarity, if we ever get to see them.  (Would
two different libraries call themselves "pqtypes", for example?)

-- 
Alvaro Herrera                                http://www.CommandPrompt.com/
PostgreSQL Replication, Consulting, Custom Development, 24x7 support


pgsql-hackers by date:

Previous
From: pgsql@mohawksoft.com
Date:
Subject: Re: Function call order dependency
Next
From: "Robert Haas"
Date:
Subject: Re: Function call order dependency