pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: karel.knezourek@gmail.com
To: pgsql-bugs@postgresql.org
Subject: BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
Date: Fri, 11 Jul 2014 04:06:53 +0000
Message-ID: <20140711040653.2776.16311@wrigleys.postgresql.org> (raw)
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-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



view thread (2+ messages)  latest in thread

Message-ID: <20140711040653.2776.16311@wrigleys.postgresql.org>
Permalink:  ../20140711040653.2776.16311@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/20140711040653.2776.16311@wrigleys.postgresql.org

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: karel.knezourek@gmail.com
  Subject: Re: BUG #10922: row_to_json creates invalid JSON for currecy lower then 1000.
  In-Reply-To: <20140711040653.2776.16311@wrigleys.postgresql.org>
  References: <20140711040653.2776.16311@wrigleys.postgresql.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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