Re: [PATCHES] libpq type system 0.9a

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Alvaro Herrera <alvherre(at)commandprompt(dot)com>, Martijn van Oosterhout <kleptog(at)svana(dot)org>, Greg Sabino Mullane <greg(at)turnstep(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: [PATCHES] libpq type system 0.9a
Date: 2008-04-08 23:45:27
Message-ID: 47FC0397.3020308@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Tom Lane wrote:
> Andrew Chernow <ac(at)esilo(dot)com> writes:
>> Kinda what my last suggestion was. Some tid-bits need to be reside in libpq,
>> but very little. I was thinking PQtypesEnable(bool) which would dlopen
>> libpqtypes and map all functions needed. This would leave the function bodies
>> of PQputf, PQgetf, PQparamExec, etc... as simple proxy functions to the
>> dynamically loaded functions. This removes any bloat that people don't like
>> right now but still allows one to use libpq as the primary interface, rather
>> than having to fiddle with libpq and some other API.
>
> This is still 100% backwards. My idea of a libpq hook is something that
> could be used by libpgtypes *and other things*. What you are proposing
> is something where the entire API of the supposed add-on is hard-wired
> into libpq. That's just bad design, especially when the adequacy of
> the proposed API is itself in question.
>
> When I say I'd accept some hooks into libpq, I mean some hooks that
> could be used by either libpgtypes or something that would like to do
> something roughly similar but with a different API offered to clients.
> The particular hook that you seem to mostly need is the ability to
> allocate some private memory associated with a particular PGconn object,
> and maybe also with individual PGresults, and then to be able to free
> that at PQclear or PQfinish. Try designing it like that.
>
> regards, tom lane
>

My idea was not a response to your hook idea. It was different
altogether.

My idea is trying to create one interface where some parts need to be
enabled (nothing wrong with that design, this is a plugin-like model).

Your idea creates two interfaces where one of them can hook into the
other. These are two different concepts.

the question is, are you asking for two different interfaces or are you
just looking to minimize overhead. I thought it was the latter which is
why I proposed a plugin-like model. It removes bloat as well as
maintains a single interface. Nothing wrong with the design unless it
doesn't meet your requirements.

Andrew

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jonah H. Harris 2008-04-09 00:00:27 Setting a pre-existing index as a primary key
Previous Message Tom Lane 2008-04-08 23:29:44 Re: [PATCHES] libpq type system 0.9a

Browse pgsql-patches by date

  From Date Subject
Next Message Gregory Stark 2008-04-08 23:59:49 Re: EXPLAIN progress info
Previous Message Tom Lane 2008-04-08 23:29:44 Re: [PATCHES] libpq type system 0.9a