Re: [PATCHES] libpq type system 0.9a

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Jeff Davis" <pgsql(at)j-davis(dot)com>
Cc: "Bruce Momjian" <bruce(at)momjian(dot)us>, "Andrew Chernow" <ac(at)esilo(dot)com>, "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 01:49:44
Message-ID: b42b73150804081849o316754a8tb9f4c20131254eb6@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

On Tue, Apr 8, 2008 at 9:28 PM, Jeff Davis <pgsql(at)j-davis(dot)com> wrote:

with proposed changes, (I think) all your suggestions are addressed/moot. see:

> * The ability to choose some result columns to be binary-formatted and
> others to be text-formatted. I haven't thought of a reasonable API for
> this yet, particularly since we already have so many ways of executing a
> statement.

with PQgetf, you are abstracted from resultformat. The library
converts your data for you into consistent types (in practice, the
result format is always binary)...without the 'negatives' of dealing
with binary data.

> * an "escapeIdent" function.

not sure what this is...

> * PQescapeBytea escapes for both inclusion in a SQL statement and also
> the escaping for the input function for bytea. This means that, if you
> are passing a binary value as a text-format parameter, using
> PQescapeBytea is incorrect, and you need to write your own octal escape
> routine. This is obviously a minor complaint, and may not even be worth
> polluting the namespace. I only mention it because it seems like an easy
> mistake to make.

PQescapeBytea is unnecessary with proposed patch...input parameters
are moved to proper format by the library. You simply %bytea the
parameter and let the library handle the rest.

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Chernow 2008-04-09 02:05:13 Re: [PATCHES] libpq type system 0.9a
Previous Message Andrew Dunstan 2008-04-09 01:46:18 Re: Concurrent psql patch

Browse pgsql-patches by date

  From Date Subject
Next Message Andrew Chernow 2008-04-09 02:05:13 Re: [PATCHES] libpq type system 0.9a
Previous Message Andrew Dunstan 2008-04-09 01:46:18 Re: Concurrent psql patch