pg.ddx.io pgsql-bugs@postgresql.org mailing list archive
help / color / mirror / Atom feedBUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
2+ messages / 2 participants
[nested] [flat]
* BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
@ 2014-07-11 04:06 karel.knezourek@gmail.com
0 siblings, 1 reply; 2+ messages in thread
From: karel.knezourek@gmail.com @ 2014-07-11 04:06 UTC (permalink / raw)
To: pgsql-bugs
The following bug has been logged on the website:
Bug reference: 10922
Logged by: Karel Knezourek
Email address: karel.knezourek@gmail.com
PostgreSQL version: 9.4beta1
Operating system: linux
Description:
select version();
--"PostgreSQL 9.4devel on x86_64-unknown-linux-gnu, compiled by gcc (GCC)
4.4.7 20120313 (Red Hat 4.4.7-4), 64-bit"
--"PostgreSQL 9.3.4, compiled by Visual C++ build 1600, 64-bit"
-- 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":"1 000,34 Kč"} OK
drop table test;
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
@ 2014-07-11 21:49 Tom Lane <tgl@sss.pgh.pa.us>
parent: karel.knezourek@gmail.com
0 siblings, 0 replies; 2+ messages in thread
From: Tom Lane @ 2014-07-11 21:49 UTC (permalink / raw)
To: karel.knezourek@gmail.com; +Cc: pgsql-bugs
karel.knezourek@gmail.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":"1 000,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
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2014-07-11 21:49 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2014-07-11 04:06 BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000. karel.knezourek@gmail.com
2014-07-11 21:49 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox