Re: WIP Patch: Add a function that returns binary JSONB as a bytea - Mailing list pgsql-hackers

From Tom Lane
Subject Re: WIP Patch: Add a function that returns binary JSONB as a bytea
Date
Msg-id 19694.1540987368@sss.pgh.pa.us
Whole thread Raw
In response to WIP Patch: Add a function that returns binary JSONB as a bytea  (Kevin Van <kevinvan@shift.com>)
Responses Re: WIP Patch: Add a function that returns binary JSONB as a bytea  (Stephen Frost <sfrost@snowman.net>)
List pgsql-hackers
Kevin Van <kevinvan@shift.com> writes:
> This patch adds a new function that allows callers to receive binary jsonb.
> This change was proposed in the discussion here:
> https://www.postgresql.org/message-id/CAOsiKEL7%2BKkV0C_hAJWxqwTg%2BPYVfiGPQ0yjFww7ECtqwBjb%2BQ%40mail.gmail.com
> and the primary motivation is to reduce database load by skipping jsonb to
> string conversion (with the expectation that the application can parse
> binary jsonb).

I dunno, I do not think it's a great idea to expose jsonb's internal
format to the world.  We intentionally did not do that when the type
was first defined --- that's why its binary I/O format isn't already
like this --- and I don't see that the tradeoffs have changed since then.
The format is complex, and specific to Postgres' needs, and we might wish
to change it in future.

            regards, tom lane


pgsql-hackers by date:

Previous
From: Dmitry Dolgov
Date:
Subject: Re: Pluggable Storage - Andres's take
Next
From: Stephen Frost
Date:
Subject: Re: INSTALL file