Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement - Mailing list pgsql-hackers

From Ivan Trofimov
Subject Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement
Date
Msg-id 2b9c6c1f-d5fc-cc29-c387-95abb815d12d@yandex.ru
Whole thread Raw
In response to Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement  ("Andrey M. Borodin" <x4mmm@yandex-team.ru>)
Responses Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement
List pgsql-hackers
>> In a presumably very common case of repeatedly executing the same statement, this leads to
>> both client and server parsing/sending exactly the same RowDescritpion data over and over again.
>> Instead, library user could acquire a statement result RowDescription once (via PQdescribePrepared),
>> and reuse it in subsequent calls to PQexecPrepared and/or its async friends.
> But what if query result structure changes? Will we detect this error gracefully and return correct error?

Afaik changing prepared statement result structure is prohibited by
Postgres server-side, and should always lead to "ERROR: cached plan
must not change result type", see src/test/regress/sql/plancache.sql.

So yes, from the libpq point of view this is just an server error, which
would be given to the user, the patch shouldn't change any behavior here.

The claim about this always being a server-side error better be
reassured from someone from the Postgres team, of course.



pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Missing docs on AT TIME ZONE precedence?
Next
From: Tom Lane
Date:
Subject: Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement