Re: Any way to *not* use server-side prepared statements in Postgresql?

Поиск
Список
Период
Сортировка
От Oliver Jowett
Тема Re: Any way to *not* use server-side prepared statements in Postgresql?
Дата
Msg-id CA+0W9LMZ1B1k0=NZcPsf7vi+jcL4QnO5sA4k3=Ca_vx63WCrdQ@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Any way to *not* use server-side prepared statements in Postgresql?  (Yang Zhang <yanghatespam@gmail.com>)
Ответы Re: Any way to *not* use server-side prepared statements in Postgresql?  (Yang Zhang <yanghatespam@gmail.com>)
Список pgsql-jdbc
On 19 July 2011 15:03, Yang Zhang <yanghatespam@gmail.com> wrote:
> On Mon, Jul 18, 2011 at 7:50 PM, Oliver Jowett <oliver@opencloud.com> wrote:

>> You can use the v2 protocol (which inserts parameter values as text,
>> rather than sending them out of line), but you will lose various other
>> bits of driver functionality that depend on the v3 protocol.
>
> Hmm...this sounded promising until I found that I'm using Python
> psycopg2.4. They wrap libpq and dropped v2 protocol support by
> psycopg2.3 (http://wiki.postgresql.org/images/7/77/Psycopg-2010-stuttgart.pdf),
> yet the statements that are being issued still appear as above. I'll
> still give the v2 protocol a shot, but something is inconsistent here.

Probably it is using the simple query protocol, not the extended query
protocol that the JDBC driver uses.

I would expect the simple protocol to perform essentially the same as
the extended protocol for an identical query string with no
driver-handled parameters.
If you're seeing differences, I suspect you're not actually doing what
you think you're doing. Perhaps you have driver-provided parameters?
There are some cases that tickle server-side query planning issues,
where using the unnamed statement with parameters doesn't result in
the same query plan as inserting the parameter values as text in the
query string yourself.

Oliver

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

Предыдущее
От: Yang Zhang
Дата:
Сообщение: Re: Any way to *not* use server-side prepared statements in Postgresql?
Следующее
От: Yang Zhang
Дата:
Сообщение: Re: Any way to *not* use server-side prepared statements in Postgresql?