Re: BUG #8676: Bug Money JSON - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #8676: Bug Money JSON
Date
Msg-id 10585.1387294268@sss.pgh.pa.us
Whole thread Raw
In response to Re: BUG #8676: Bug Money JSON  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: BUG #8676: Bug Money JSON  (Andrew Dunstan <andrew@dunslane.net>)
List pgsql-bugs
Andrew Dunstan <andrew@dunslane.net> writes:
>> On Wed, Dec 11, 2013 at 02:30:04PM +0000, email@andersonloyola.com.br wrote:
>>> postgres=# SELECT to_json(a) FROM (VALUES(1000::money)) a(salario);
>>> to_json
>>> -----------------------
>>> {"salario":$1,000.00}
>>> (1 row)

> Yeah. I'll have a look. In fact this looks like it's possibly a couple
> of bugs. The JSON produced by the first query is not valid. It looks
> like we might need to force money to text unconditionally.

Isn't this simply failure to quote the string properly?  What drives
to_json's choice of whether to quote or not, anyway?

            regards, tom lane

pgsql-bugs by date:

Previous
From: David Johnston
Date:
Subject: Re: BUG #8678: Multiple evaluation single volatile function in select statement
Next
From: Andrew Dunstan
Date:
Subject: Re: BUG #8676: Bug Money JSON