Re: [PATCHES] libpq type system 0.9a - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: [PATCHES] libpq type system 0.9a
Date
Msg-id b42b73150804081849o316754a8tb9f4c20131254eb6@mail.gmail.com
Whole thread Raw
In response to Re: [PATCHES] libpq type system 0.9a  (Jeff Davis <pgsql@j-davis.com>)
Responses Re: [PATCHES] libpq type system 0.9a  (Jeff Davis <pgsql@j-davis.com>)
List pgsql-hackers
On Tue, Apr 8, 2008 at 9:28 PM, Jeff Davis <pgsql@j-davis.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


pgsql-hackers by date:

Previous
From: "Merlin Moncure"
Date:
Subject: Re: [PATCHES] libpq type system 0.9a
Next
From: Jeff Davis
Date:
Subject: Re: [PATCHES] libpq type system 0.9a