Re: libpq object hooks

Поиск
Список
Период
Сортировка
От Alvaro Herrera
Тема Re: libpq object hooks
Дата
Msg-id 20080514043313.GS6966@alvh.no-ip.org
обсуждение исходный текст
Ответ на Re: libpq object hooks  (Andrew Dunstan <andrew@dunslane.net>)
Ответы Re: libpq object hooks  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-patches
Andrew Dunstan escribió:

> The thing that is a bit disturbing is that the whole style of this
> scheme is very different from the fairly simple APIs that the rest of
> libpq presents. It's going to make libpq look rather odd, I think. I
> would have felt happier if the authors had been able to come up with a
> simple scheme to add API calls to export whatever information they
> needed, rather than using this callback scheme.

I'm not sure I understand this point.  Remember that this is here to
support the libpqtypes library.  There doesn't seem to be a way for an
API such as you describe to work.

> Second, the hook names are compared case insensitively and by linear
> search. I don't see any justification for using case insensitive names
> for hooks in a C program, so I think that part should go. And if we
> expect to keep anything other than trivial numbers of hooks we should
> look at some sort of binary or hashed search.

Keep in mind that the original patch supported a single hook being
registered.  Perhaps we could dream about having a couple of hooks
registered, but turning into hashed search would seem to be overkill, at
least for now.  (If hooking into libpq is truly successful we can always
improve it later -- it's not an exported detail of the API after all.)

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: libpq object hooks
Следующее
От: Magnus Hagander
Дата:
Сообщение: Re: stored procedure stats in collector