Re: WIP json generation enhancements - Mailing list pgsql-hackers

From Robert Haas
Subject Re: WIP json generation enhancements
Date
Msg-id CA+TgmoZXBZ13ScQyoBHym6q4Nx-zMQCDsM=SyiQ9DxxuzSoyrw@mail.gmail.com
Whole thread Raw
In response to Re: WIP json generation enhancements  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: WIP json generation enhancements
List pgsql-hackers
On Mon, Nov 26, 2012 at 11:43 AM, Andrew Dunstan <andrew@dunslane.net> wrote:
> I don't understand why you would want to create such a cast. If the cast
> doesn't exist it will do exactly what it does now, i.e. use the type's
> output function and then json quote and escape it, which in the case of
> citext is the Right Thing (tm):
>
>    andrew=# select to_json('foo"bar'::citext);
>       to_json
>    ------------
>      "foo\"bar"

I'm not sure either, but setting up a system where seemingly innocuous
actions can in fact have surprising and not-easily-fixable
consequences in other parts of the system doesn't seem like good
design to me.  Of course, maybe I'm misunderstanding what will happen;
I haven't actually tested it myself.

-- 
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company



pgsql-hackers by date:

Previous
From: Thangalin
Date:
Subject: Transform mapped XPath expressions into XML containing relational data
Next
From: Merlin Moncure
Date:
Subject: Re: WIP json generation enhancements