Re: Under what circumstances does PreparedStatement use stored plans?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Under what circumstances does PreparedStatement use stored plans?
Дата
Msg-id 29504.1081911890@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: Under what circumstances does PreparedStatement use stored plans?  (James Robinson <jlrobins@socialserve.com>)
Ответы Re: Under what circumstances does PreparedStatement use stored plans?
Список pgsql-jdbc
James Robinson <jlrobins@socialserve.com> writes:
> Diving in, I see that Postgres's PREPARE statement needs the types
> up-front, as in:
>     PREPARE t_prep (TEXT) as select id from users where name = $1;

Yes, but that is not the facility you want to use.  The facility that
was specifically designed to support JDBC is the V3-protocol prepare/
bind/execute message group.  That stuff can push back inferred parameter
types, which is what I think you are looking for.  See
http://www.postgresql.org/docs/7.4/static/protocol.html
particularly
http://www.postgresql.org/docs/7.4/static/protocol-flow.html#AEN52666
There's also a bunch of discussion in the mail list archives from about
a year ago.

            regards, tom lane

В списке pgsql-jdbc по дате отправления:

Предыдущее
От: James Robinson
Дата:
Сообщение: Re: Statement pooling implementation (was Re: Under what circumstances does PreparedStatement use stored plans?)
Следующее
От: James Robinson
Дата:
Сообщение: Re: Under what circumstances does PreparedStatement use stored plans?