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

From Christophe Pettus
Subject Re: Problem with the default registration of the JSON adapter
Date
Msg-id BA764249-F0F4-4572-90B1-2D3804583620@thebuild.com
Whole thread Raw
In response to Re: Problem with the default registration of the JSON adapter  (Federico Di Gregorio <federico.digregorio@dndg.it>)
Responses Re: Problem with the default registration of the JSON adapter  (Daniele Varrazzo <daniele.varrazzo@gmail.com>)
List psycopg
On Jul 22, 2013, at 9:06 AM, Federico Di Gregorio wrote:

> 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.

I have to say that I find the current situation pleasing: psycopg2 does the most natural thing with the type (converts
itto a data structure, which is after all what json is encoding) if you ask for the base type.  If you want the text
version,just cast it to the text version in the query, and that's what you get, parallel with every other type. 

--
-- Christophe Pettus
   xof@thebuild.com



psycopg by date:

Previous
From: Federico Di Gregorio
Date:
Subject: Re: Problem with the default registration of the JSON adapter
Next
From: "Frank Millman"
Date:
Subject: Problem with memoryview