Re: Request for comment on setting binary format output per session

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Request for comment on setting binary format output per session
Дата
Msg-id dd730387ca62e6450071bcfa6daf1d665adcf4f4.camel@j-davis.com
обсуждение исходный текст
Ответ на Re: Request for comment on setting binary format output per session  (Merlin Moncure <mmoncure@gmail.com>)
Ответы Re: Request for comment on setting binary format output per session  (Dave Cramer <davecramer@gmail.com>)
Список pgsql-hackers
On Thu, 2023-03-30 at 07:06 -0500, Merlin Moncure wrote:
> This ought to be impossible IMO.  All libpq routines except PQexec
> have an explicit expectation on format (via resultformat parameter)
> that should not be overridden.  PQexec ought to be explicitly
> documented and wired to only request text format data.

Right now it's clearly documented[1] which formats will be returned for
a given Bind message. That can be seen as the root of the problem with
psql -- we are breaking the protocol by returning binary when psql can
rightfully expect text.

It is a minor break, because something needed to send the "SET
binary_formats='...'" command, but the protocol docs would need to be
updated for sure.

> participating clients to receive GUC configured format.  I do not
> think that libpq's result format being able to be overridden by GUC
> is a good idea at all, the library has to to participate, and I
> think can be made to so so without adjusting the interface (say, by
> resultFormat = 3).

Interesting idea. I suppose you'd need to specify 3 for all result
columns? That is a protocol change, but wouldn't "break" older clients.
The newer clients would need to make sure that they're connecting to
v16+, so using the protocol version alone wouldn't be enough. Hmm.

Regards,
    Jeff Davis

[1]
https://www.postgresql.org/docs/current/protocol-message-formats.html#PROTOCOL-MESSAGE-FORMATS-BIND




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

Предыдущее
От: Daniel Gustafsson
Дата:
Сообщение: Re: Should vacuum process config file reload more often
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Transparent column encryption