From: Mikko Tiihonen <Mikko.Tiihonen@nitorcreations.com>
To: Dave Cramer <pg@fastcrypt.com>
To: Christopher BROWN <brown@reflexe.fr>
Cc: List <pgsql-jdbc@postgresql.org>
Subject: Re: Postgresql 9.4 / JSONB / JDBC
Date: Wed, 31 Dec 2014 18:29:35 +0000
Message-ID: <1420050573364.92662@nitorcreations.com> (raw)
In-Reply-To: <CADK3HH+qeiuw7tmLjhoR3QSVvZbD0P_nw7DRHXH-P8mWq2QF1A@mail.gmail.com>
References: <CAHL_zcMcQbStg7fgH2peKVtC=h+2a38=ikr3SiPhk3N5tDk0eA@mail.gmail.com>
<CAHL_zcMdOoan=1UBYvA898EkoH70H_kk9iQbMDV7QnNT2=JzVg@mail.gmail.com>
<CADK3HH+qeiuw7tmLjhoR3QSVvZbD0P_nw7DRHXH-P8mWq2QF1A@mail.gmail.com>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-jdbc>
Last time I checked (few months ago), the postgresql jsonb binary format was just a extra 4 byte version header followed by text json data. So basically the binary jsonb format was slower than text format. And since there is no official plan on how to modify the binary formats without breaking backwards compatibility it most likely will stay that way.
Having a proper binary encoding for jsonb would speed up parsing on both server and client side.
-Mikko
________________________________
From: pgsql-jdbc-owner@postgresql.org <pgsql-jdbc-owner@postgresql.org> on behalf of Dave Cramer <pg@fastcrypt.com>
Sent: 29 December 2014 13:42
To: Christopher BROWN
Cc: List
Subject: Re: [JDBC] Postgresql 9.4 / JSONB / JDBC
Yes, we can pull the data from the server in binary. After that though we have to convert it to text
Dave Cramer
dave.cramer(at)credativ(dot)ca
http://www.credativ.ca
On 29 December 2014 at 05:08, Christopher BROWN <brown@reflexe.fr<mailto:brown@reflexe.fr>> wrote:
Hello,
Regarding my previous messages on this subject (JSONB support in the Postgresql JDBC driver), one assumption I'm making is that the driver might be able to stream the JSON data more efficiently that just throwing a chunk of text onto the wire... as text isn't the most efficient way of encoding numbers, booleans, and nulls.
How does the native network protocol of Postgresql actually transfer such data? Is there an opportunity for sending the data efficiently? Personally for some of my applications, I'm able to use Jackson's "Smile" binary JSON format, although I doubt that the Postgresql server would understand it or want to implement it (I don't know if it could be considered a standard, even if it's specified -- http://wiki.fasterxml.com/SmileFormatSpec).
--
Christopher
On 20 December 2014 at 10:44, Christopher BROWN <brown@reflexe.fr<mailto:brown@reflexe.fr>> wrote:
Hello,
I'm new to this list, and have tried searching both the mailing list archives, and internet in general, for information on how to use the new JSONB data type with JDBC. Found almost nothing in the mailing list archives, and internet searches "helpfully" assume I've misspelled "json" and give me results that are unrelated or refer to the basic "JSON" type from older Postgresql versions.
How can this type be used, with simple "flat" key-value collections (maps), with tree-like maps-of-maps, and (ideally) with JSON APIs such as Jackson JSON API?
Is it possible? Is it already described somewhere that I missed?
Thanks,
Christopher
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-jdbc@postgresql.org
Cc: Mikko.Tiihonen@nitorcreations.com, pg@fastcrypt.com, brown@reflexe.fr
Subject: Re: Postgresql 9.4 / JSONB / JDBC
In-Reply-To: <1420050573364.92662@nitorcreations.com>
References: <CAHL_zcMcQbStg7fgH2peKVtC=h+2a38=ikr3SiPhk3N5tDk0eA@mail.gmail.com> <CAHL_zcMdOoan=1UBYvA898EkoH70H_kk9iQbMDV7QnNT2=JzVg@mail.gmail.com> <CADK3HH+qeiuw7tmLjhoR3QSVvZbD0P_nw7DRHXH-P8mWq2QF1A@mail.gmail.com> <1420050573364.92662@nitorcreations.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox