Re: json casts

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, Stephen Frost <sfrost(at)snowman(dot)net>, Hannu Krosing <hannu(at)2ndQuadrant(dot)com>, Heikki Linnakangas <hlinnakangas(at)vmware(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: json casts
Date: 2014-06-03 21:55:37
Message-ID: 538E4459.1040602@dunslane.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On 06/03/2014 04:45 PM, Tom Lane wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> This was solved back in the day for the xml type, which has essentially
>> the same requirement, by adding an ISO-8601-compatible output option to
>> EncodeDateTime(). See map_sql_value_to_xml_value() in xml.c. You ought
>> to be able to reuse that. Seems easier than routing through to_char().
> I was wondering if we didn't have another way to do that. to_char() is
> squirrely enough that I really hate having any other core functionality
> depending on it. +1 for changing this.
>
>

It's a bit of a pity neither of you spoke up in the 6 days since I
published the draft patch. And honestly, some of the other code invoked
by the XML code looks a bit squirrely too. But, OK, I will look at it. I
guess I can assume that the output won't contain anything that needs
escaping, so I can just add the leading and trailing quote marks without
needing to call escape_json().

cheers

andrew

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2014-06-03 21:58:08 Re: idle_in_transaction_timeout
Previous Message Alvaro Herrera 2014-06-03 21:55:16 Re: idle_in_transaction_timeout