Re: Problem with the default registration of the JSON adapter - Mailing list psycopg

From Federico Di Gregorio
Subject Re: Problem with the default registration of the JSON adapter
Date
Msg-id 51ED5871.50304@dndg.it
Whole thread Raw
In response to Re: Problem with the default registration of the JSON adapter  (Christophe Pettus <xof@thebuild.com>)
Responses Re: Problem with the default registration of the JSON adapter  (Christophe Pettus <xof@thebuild.com>)
List psycopg
On 22/07/2013 17:55, Christophe Pettus wrote:
> On Jul 22, 2013, at 8:20 AM, Federico Di Gregorio wrote:
>
>>> JSON is different because the representation you get is exactly
>>> the representation you may want to send to the the client
>>> (probably over HTTP) and the conversion text->json objects->text
>>> uses quite a bit of cpu/memory.

> If you want the text version, you can ask for the text version; I
> don't think it's worth breaking an existing API over.  We already
> have a precedent here in hstore.

Apart from the fact that hstore in text format is pretty much unusable:
there was no other type that has multiple useful representations until
PostgreSQL introduced json.

Looking forward, I'd say that if a type has only one useful
representation, that one should be used; but if it has multiple useful
representations the *simplest* one should be the default.

federico


psycopg by date:

Previous
From: Christophe Pettus
Date:
Subject: Re: Problem with the default registration of the JSON adapter
Next
From: Christophe Pettus
Date:
Subject: Re: Problem with the default registration of the JSON adapter