Re: libpq and prepared statements progress for 8.0 - Mailing list pgsql-hackers

From Merlin Moncure
Subject Re: libpq and prepared statements progress for 8.0
Date
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A74AF@Herge.rcsinc.local
Whole thread Raw
In response to libpq and prepared statements progress for 8.0  ("Greg Sabino Mullane" <greg@turnstep.com>)
Responses Re: libpq and prepared statements progress for 8.0  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
> A bit of context here. The perl DBD::Pg developers are trying to
figure
> out
> how to implement prepared queries sanely. As it stands now they're
> basically
> writing off both binary prepared queries and SQL based prepared
queries as
> basically useless. It would be a shame to have a brand new binary
protocol
> but
> find it ignored by driver writers.
>
> The problem is that you want to be able to do
>
>  $sth = $dbh->prepare("SELECT col_a FROM tab WHERE col_b = ?");
>  $sth->execute(1);
>  ...
>
> And not have to jump through hoops binding parameters to types and so
on.
>

suggestion: default to text type ('character varying') and overload your
prepare method to allow a vector of types for special cases.  It follows
that if you don't know what type you are dealing with than it gets dealt
with as a string.

Question: what is the relevance of the binary protocol, are you trying
to send/fetch binary data via the command interface?

Merlin



pgsql-hackers by date:

Previous
From: Dennis Bjorklund
Date:
Subject: Re: Is select a transaction starting statement?
Next
From: Bruce Momjian
Date:
Subject: Re: SELECT FOR UPDATE NOWAIT and PostgreSQL 8.0