Re: JSON output from psql

Поиск
Список
Период
Сортировка
От Chapman Flack
Тема Re: JSON output from psql
Дата
Msg-id 5EBC601E.3020704@anastigmatix.net
обсуждение исходный текст
Ответ на Re: JSON output from psql  (Gurjeet Singh <gurjeet@singh.im>)
Ответы Re: JSON output from psql  (Gurjeet Singh <gurjeet@singh.im>)
Список pgsql-hackers
On 05/13/20 16:16, Gurjeet Singh wrote:
> On Wed, May 13, 2020 at 1:14 PM Gurjeet Singh <gurjeet@singh.im> wrote:
>>
>> Arguably, delivering JSON (with its repeating attribute names in every
>> element of the array, dquotes and commas) is more network intensive
>> than converting the resultset to JSON on [client] side.

Does this suggest perhaps some sort of hybrid approach, where jsonbc
could be available as a binary on-the-wire format and the client only
needs the ability to deparse it: a query on the server could marshal
the results into that form, the client negotiates the binary transfer
format, and deparses to normal JSON syntax on its end?

It seems the server-side "compression" to jsonbc should be optimizable
when what is happening is marshaling of a tabular result: what the
repeating keys are going to be is known up front.

Maybe could use a transient (or session lifetime?) 'external' dictionary
that gets generated and sent to the client. but not stored in
pg_jsonb_dict?

Seems like a lot of work just to get json-shaped query results from psql,
but maybe the ability to receive jsonbc on the wire would be of interest
to drivers generally.

Regards,
-Chap



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

Предыдущее
От: Laurenz Albe
Дата:
Сообщение: Re: COPY, lock release and MVCC
Следующее
От: Chapman Flack
Дата:
Сообщение: document? Re: Do I understand commit timestamps correctly?