Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvM1-0000u2-L3 for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2013 14:10:33 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1VsvM1-0001q9-3V for pgsql-bugs@arkaria.postgresql.org; Tue, 17 Dec 2013 14:10:33 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvM0-0001q2-5D for pgsql-bugs@postgresql.org; Tue, 17 Dec 2013 14:10:32 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1VsvLs-00073K-PG for pgsql-bugs@postgresql.org; Tue, 17 Dec 2013 14:10:31 +0000 Received: from bruce by momjian.us with local (Exim 4.72) (envelope-from ) id 1VsvLp-0007ts-Kt; Tue, 17 Dec 2013 09:10:21 -0500 Date: Tue, 17 Dec 2013 09:10:21 -0500 From: Bruce Momjian To: email@andersonloyola.com.br Cc: pgsql-bugs@postgresql.org, Andrew Dunstan Subject: Re: BUG #8676: Bug Money JSON Message-ID: <20131217141021.GA19059@momjian.us> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.20 (2009-06-14) 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 On Wed, Dec 11, 2013 at 02:30:04PM +0000, email@andersonloyola.com.br wrote: > The following bug has been logged on the website: > > Bug reference: 8676 > Logged by: Anderson Cristian da Silva > Email address: email@andersonloyola.com.br > PostgreSQL version: 9.3.2 > Operating system: Centos 6.3 (Final) > Description: > > Failed to convert money to json EX.: > > > postgres=# SELECT to_json(a) FROM (VALUES(1000::money)) a(salario); > to_json > ----------------------- > {"salario":$1,000.00} > (1 row) > > > postgres=# SELECT to_json(a)->'salario' FROM (VALUES(1000::money)) > a(salario); > ERROR: invalid input syntax for type json > DETAIL: Token "$" is invalid. > CONTEXT: JSON data, line 1: {"salario":$... Well, that is very interesting. It works for integer and text, and it works if you ask for the entire relation, but if you ask just for that field _and_ it is money, it fails. Sure looks like a bug to me. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + Everyone has their own god. + -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs