Re: Using JSONB directly from application

Поиск
Список
Период
Сортировка
От Craig Ringer
Тема Re: Using JSONB directly from application
Дата
Msg-id CAMsr+YEtamQYZ5EocsuthQCvyvmRnQrucDP6GZynPtf0gsMbuw@mail.gmail.com
обсуждение исходный текст
Ответ на Using JSONB directly from application  (Anthony Communier <anthony.communier@gmail.com>)
Ответы Re: Using JSONB directly from application
Список pgsql-hackers
On 26 February 2018 at 04:05, Anthony Communier <anthony.communier@gmail.com> wrote:
Hello,

It would be nice if application connected to a Postrgesql database could send and receive JSONB in binary. It could save some useless text conversion. All works could be done on application side which are often more scalable than database itself.


To support this, you'd need to extract PostgreSQL's jsonb support into a C library that could be used independently of backend server infrastructure like 'palloc' and memory contexts, ereport(), etc. Or write a parallel implementation.

It's one of the reasons some people questioned the wisdom of doing jsonb as a bespoke format not using protobufs or whatever. I'm not one of them, since I wasn't the one doing the work, and I also know how hard it can be to neatly fit general purpose library code into the DB server where we expect it to do little things like not abort() on malloc() failure.

If you're interested in writing such a library, I suggest proposing a broad design for how you intend to do it here. I suspect that duplicating enough server backend infrastructure to make the existing jsonb implementation friendly to frontend code would be frustrating, but maybe it's not as bad as I think. Certainly if you did such a thing, many people would thank you, because the inability to use ereport() and elog(), PG_TRY, the List API, etc, in FRONTEND code is a constant if minor source of irritation in PostgreSQL development.


--
 Craig Ringer                   http://www.2ndQuadrant.com/
 PostgreSQL Development, 24x7 Support, Training & Services

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

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: VACUUM FULL name is very confusing to some people (or to most nonexpert people)
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Patch: Pass IndexInfo correctly to aminsert for indexes on TOAST