Re: Problem with the default registration of the JSON adapter

From: Federico Di Gregorio <federico(dot)digregorio(at)dndg(dot)it>
To: Christophe Pettus <xof(at)thebuild(dot)com>
Cc: psycopg(at)postgresql(dot)org
Subject: Re: Problem with the default registration of the JSON adapter
Date: 2013-07-22 16:06:09
Message-ID: 51ED5871.50304@dndg.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse psycopg by date

  From Date Subject
Next Message Christophe Pettus 2013-07-22 16:13:53 Re: Problem with the default registration of the JSON adapter
Previous Message Christophe Pettus 2013-07-22 15:55:47 Re: Problem with the default registration of the JSON adapter