Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VswcF-00047N-K3 for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2013 15:31:23 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VswcE-0002Ap-S9 for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2013 15:31:22 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VswcD-0002Ai-Qc for pgsql-bugs@postgresql.org; Tue, 17 Dec 2013 15:31:21 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VswcA-0004SJ-NN for pgsql-bugs@postgresql.org; Tue, 17 Dec 2013 15:31:21 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id rBHFV8t7010586; Tue, 17 Dec 2013 10:31:08 -0500 From: Tom Lane To: Andrew Dunstan cc: Bruce Momjian , email@andersonloyola.com.br, pgsql-bugs@postgresql.org Subject: Re: BUG #8676: Bug Money JSON In-reply-to: <52B06330.1010503@dunslane.net> References: <20131217141021.GA19059@momjian.us> <52B06330.1010503@dunslane.net> Comments: In-reply-to Andrew Dunstan message dated "Tue, 17 Dec 2013 09:44:00 -0500" Date: Tue, 17 Dec 2013 10:31:08 -0500 Message-ID: <10585.1387294268@sss.pgh.pa.us> X-Pg-Spam-Score: -2.4 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org Andrew Dunstan 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 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs