Re: JSONB marshalling - Mailing list psycopg

From Daniele Varrazzo
Subject Re: JSONB marshalling
Date
Msg-id CA+mi_8Y915NC+RBfUd_Vj19khDePHirDTOQbwoz1UjGTyVJ3Uw@mail.gmail.com
Whole thread Raw
In response to Re: JSONB marshalling  (Federico Di Gregorio <fog@dndg.it>)
Responses Re: JSONB marshalling
List psycopg
On Fri, Jul 25, 2014 at 5:40 PM, Federico Di Gregorio <fog@dndg.it> wrote:

> What Daniele was asking is if someone has something against enabling it
> as default in the next point release. Given that json type
> caster/adapter is already enabled I don't see any reason to not register
> jsonb one too.

After reading this SO question
<http://stackoverflow.com/questions/25263736/jsonb-with-psycopg2-realdictcursor>
I'm thinking that users expect jsonb to work exactly like json does.
Our docs say that json is automatically converted into python objects
since psycopg 2.5
<http://initd.org/psycopg/docs/extras.html#json-adaptation> so I think
we won't get many complaints if starting from 2.5.4 we supported jsonb
the same way. Only behavioural change would be noticed by users
running an older psycopg2 version with a still-to-be-released Postgres
version, which is an odd combination at best, unlikely to be found in
the wild. it would be a better scenario if people upgrading their
schemas from json to jsonb found their default psycopg installation
not changing behaviour with the different data type.

So, if nobody shouts in disagreement, there will be a 2.5.4 released
in a few days/couple of weeks with a handful of secondary bugfixes and
jsonb support baked in.

-- Daniele


psycopg by date:

Previous
From: Joe Abbate
Date:
Subject: Re: Fastest way to insert/update many rows
Next
From: Christophe Pettus
Date:
Subject: Re: JSONB marshalling