Re: libpq object hooks (libpq events)

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Andrew Chernow <ac(at)esilo(dot)com>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: libpq object hooks (libpq events)
Date: 2008-09-03 16:55:44
Message-ID: 20080903165544.GA4114@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

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

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message pgsql 2008-09-03 16:55:45 Re: Function call order dependency
Previous Message pgsql 2008-09-03 16:46:25 Re: Function call order dependency

Browse pgsql-patches by date

  From Date Subject
Next Message Alvaro Herrera 2008-09-03 17:02:49 Re: libpq events patch
Previous Message Andrew Chernow 2008-09-03 16:26:43 libpq events patch