Re: libpq type system 0.9a - Mailing list pgsql-patches

From Merlin Moncure
Subject Re: libpq type system 0.9a
Date
Msg-id b42b73150803051531j74caab35i2cee98ea410fbe0@mail.gmail.com
Whole thread Raw
In response to Re: libpq type system 0.9a  ("Florian G. Pflug" <fgp@phlo.org>)
Responses Re: libpq type system 0.9a  (Andrew Chernow <ac@esilo.com>)
List pgsql-patches
On Wed, Mar 5, 2008 at 5:47 PM, Florian G. Pflug <fgp@phlo.org> wrote:
> Merlin Moncure wrote:
>  > Yesterday, we notified -hackers of the latest version of the libpq
>  > type system.  Just to be sure the right people are getting notified,
>  > we are posting the latest patch here as well.  Would love to get some
>  > feedback on this.
>  Sorry if this has been discussed before, but why is it necessary
>  to specify the type when calling PQgetf on a result? It seems that this
>  formatting string *always* has to match the type list of your select
>  statement, no?

yes...it always has to match.  the format string requirements could in
theory be relaxed (for 'get') but this would break symmetry with 'put'
and you would lose a sanity check...getf like scanf writes directly
into application memory so the double-specifying (directly in the
format string and indirectly in the query) isn't necessarily a bad
thing.  imagine if your application was 'select * from table' and one
of the field types changed...disaster.

merlin

pgsql-patches by date:

Previous
From: "Florian G. Pflug"
Date:
Subject: Re: libpq type system 0.9a
Next
From: Andrew Chernow
Date:
Subject: Re: libpq type system 0.9a