Re: libpq and prepared statements progress for 8.0

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: libpq and prepared statements progress for 8.0
Дата
Msg-id 6EE64EF3AB31D5448D0007DD34EEB3412A74AF@Herge.rcsinc.local
обсуждение исходный текст
Ответ на libpq and prepared statements progress for 8.0  ("Greg Sabino Mullane" <greg@turnstep.com>)
Ответы Re: libpq and prepared statements progress for 8.0  (Tom Lane <tgl@sss.pgh.pa.us>)
Список 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 по дате отправления:

Предыдущее
От: Dennis Bjorklund
Дата:
Сообщение: Re: Is select a transaction starting statement?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: SELECT FOR UPDATE NOWAIT and PostgreSQL 8.0