Re: [PATCHES] libpq type system 0.9a

From: Andrew Chernow <ac(at)esilo(dot)com>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Merlin Moncure <mmoncure(at)gmail(dot)com>, Gregory Stark <stark(at)enterprisedb(dot)com>, Jeff Davis <pgsql(at)j-davis(dot)com>, Bruce Momjian <bruce(at)momjian(dot)us>, Joe Conway <mail(at)joeconway(dot)com>, Alvaro Herrera <alvherre(at)commandprompt(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [PATCHES] libpq type system 0.9a
Date: 2008-04-09 12:14:58
Message-ID: 47FCB342.7020301@esilo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Andrew Dunstan wrote:
>
>
> Merlin Moncure wrote:
>> However, due to libpq limitations, if any datatype must
>> return text the entire result must be text (resultFormat)...this is
>
> I'm surprised you didn't try to address that limitation.
>
>

That would change the existing behavior of resultFormat, although not terribly.
Currently, the server will spit back an error if you use binary results but
some type hasn't implemented a send/recv. Instead of an error, the server could
"fallback" to the type's in/out routines and mark the column as text format.

I think the "fallback" approach is more intelligent behavior but such a change
could break libpq clients. They might be blindly ASSuming if the exec worked
with resultFormat=1, that everything returned by PQgetvalue will be binary (I'm
guilty of this one, prior to libpqtypes).

Our patch would work with no changes because it supports text and binary
results. So, each type handler already toggles itself based on PQfformat.

--
Andrew Chernow
eSilo, LLC
every bit counts
http://www.esilo.com/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2008-04-09 12:25:27 Re: [PATCHES] libpq type system 0.9a
Previous Message Merlin Moncure 2008-04-09 12:14:56 Re: [PATCHES] libpq type system 0.9a

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Dunstan 2008-04-09 12:25:27 Re: [PATCHES] libpq type system 0.9a
Previous Message Merlin Moncure 2008-04-09 12:14:56 Re: [PATCHES] libpq type system 0.9a