Re: libpq object hooks (libpq events)

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: libpq object hooks (libpq events)
Дата
Msg-id 20080903165544.GA4114@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: libpq object hooks (libpq events)  (Andrew Chernow <ac@esilo.com>)
Ответы Re: libpq object hooks (libpq events)
Список 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 по дате отправления:

Предыдущее
От: pgsql@mohawksoft.com
Дата:
Сообщение: Re: Function call order dependency
Следующее
От: "Robert Haas"
Дата:
Сообщение: Re: Function call order dependency