Re: BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: karel(dot)knezourek(at)gmail(dot)com
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
Date: 2014-07-11 21:49:14
Message-ID: 21420.1405115354@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

karel(dot)knezourek(at)gmail(dot)com writes:
> -- TEST CASE
> CREATE TABLE test
> (
> currency money
> );

> INSERT INTO test(currency) SELECT '1.34'::float8::numeric::money;
> INSERT INTO test(currency) SELECT '1000.34'::float8::numeric::money;
> SELECT row_to_json(t) FROM (SELECT * FROM TEST) t;
> --{"currency":1,34 K} NOT OK !!! it is not valid JSON without double quotes

> --{"currency":"1000,34 K"} OK

Thanks for the report! I can't reproduce this on HEAD. I think it
should have been resolved by commit 0ca6bda8e, but that was done a
couple of days before we stamped 9.4beta1. Are you sure this is
exactly beta1, and not some slightly earlier version? Your
version() output looks like it predates beta1 ...

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Michael Paquier 2014-07-12 06:14:54 Re: Missing file versions for a bunch of dll/exe files in Windows builds
Previous Message Larry Rosenman 2014-07-11 17:05:22 Re: Compile fails on AIX 6.1