Re: [PATCHES] libpq type system 0.9a

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Gregory Stark" <stark(at)enterprisedb(dot)com>
Cc: "Andrew Chernow" <ac(at)esilo(dot)com>, "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Bruce Momjian" <bruce(at)momjian(dot)us>, "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-10 15:14:45
Message-ID: b42b73150804100814w22b2131fr5b906c2474fc1dc6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Thu, Apr 10, 2008 at 10:56 AM, Gregory Stark <stark(at)enterprisedb(dot)com> wrote:
> "Andrew Chernow" <ac(at)esilo(dot)com> writes:
> > How would the caller of getvalues know whether the error was generated by a
> > libpqtypes API call or by a libpq API call (like PQgetvalue)? PQgetf should
> > behave exactely as PQgetvalue does, in regards to errors.
>
> Hm. Well I was thinking of errors from database operations rather than things
> like PQgetvalue.
>
> I suppose we have to decide whether pqtypes is a "wrapper" around libpq in
> which case your functions would have to take the libpq error and copy it into
> your error state or an additional set of functions which are really part of
> appendage of libpq

We see libpq types to be simply extending the api with more functions.
We really only introduce new error handling with the PGparam struct
that is following the same conventions that exist currently. The
separation of libpqtypes out of libpq into a new library is an
architectural change for organization purposes. We are not defining a
new api or wrapping an existing one for new functionality (which is
the same thing imo). With that in mind, libpq's error system is
object based, not library based. Thee three objects that set errors
are result, conn, (and now), param. In libpq terms there is no global
error. (no errno, getlasterror, etc).

So, if I understand you correctly, we see libpqtypes is an appendage
in your terms...were you thinking along different lines? Consider
that we don't reproduce all the things libpq offers, we share the same
objects, etc. (In fact, we went though some acrobatics to introduce as
little new behavior as possible).

merlin

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Aidan Van Dyk 2008-04-10 15:15:08 Re: Commit fest queue
Previous Message Aidan Van Dyk 2008-04-10 15:12:02 Re: Commit fest queue

Browse pgsql-patches by date

  From Date Subject
Next Message Magnus Hagander 2008-04-10 15:16:01 Re: Fix for win32 stat() problems
Previous Message Gregory Stark 2008-04-10 14:56:49 Re: [PATCHES] libpq type system 0.9a