Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-28 Thread Ivan Trofimov
Hi Tom! Thank you for considering this. It adds a whole new set of programmer-error possibilities, and I doubt it saves enough in typical cases to justify creating such a foot-gun. Although I agree it adds a considerable amount of complexity, I'd argue it doesn't bring the complexity to a new

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-26 Thread Tom Lane
Ivan Trofimov writes: > 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. Independently of whether we're willing to guarantee that that

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-26 Thread Ivan Trofimov
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

Re: WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-21 Thread Andrey M. Borodin
Hi Ivan, thank you for the patch. > On 22 Nov 2023, at 03:58, Ivan Trofimov wrote: > > Currently libpq sends B(ind), D(escribe), E(execute), S(ync) when executing a > prepared statement. > The response for that D message is a RowDescription, which doesn't change > during prepared > statement

WIP: libpq: add a possibility to not send D(escribe) when executing a prepared statement

2023-11-21 Thread Ivan Trofimov
Hi! Currently libpq sends B(ind), D(escribe), E(execute), S(ync) when executing a prepared statement. The response for that D message is a RowDescription, which doesn't change during prepared statement lifetime (with the attributes format being an exception, as they aren't know before