From: dgrelaud@ideolys.com
To: pgsql-bugs@postgresql.org
Subject: BUG #11103: to_json() does not convert correctly DOMAINs type since 9.3.5 (int expected instead of string) ?
Date: Thu, 31 Jul 2014 15:24:56 +0000
Message-ID: <20140731152456.2708.35688@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: 11103
Logged by: David GRELAUD
Email address: dgrelaud@ideolys.com
PostgreSQL version: 9.3.5
Operating system: Ubuntu 12.04 or Mac OS X 10.9
Description:
Hi,
The function to_json() does not convert correctly (= as before) DOMAINs
since 9.3.5. It was OK in 9.3.4.
Here is a minimal test case :
CREATE DOMAIN UNSIGNED_INT4 AS INT4 CHECK (VALUE >= 0);
SELECT to_json(2::UNSIGNED_INT4);
With 9.3.5, it returns a JSON string : '2' (with quotes)
With 9.3.4, it returns a JSON int : 2 (without quotes)
The same behavior happens with array_to_json() and maybe others related
functions...
If we do not use domains, SELECT to_json(2::INT4) returns always a JSON int
(even with 9.3.5).
Is it related to the change made by Tom Lane?
commit 0ca6bda8e7501947c05f30c127f6d12ff90b5a64 and the release note 9.3.5
"Fix identification of input type category in to_json() and friends (Tom
Lane)"?
Is it volontary? If so, don't worry, I will find a workaround.
Thank you very much for maintaining this wonderfull Open Source database.
David.
--
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs
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: dgrelaud@ideolys.com
Subject: Re: BUG #11103: to_json() does not convert correctly DOMAINs type since 9.3.5 (int expected instead of string) ?
In-Reply-To: <20140731152456.2708.35688@wrigleys.postgresql.org>
References: <20140731152456.2708.35688@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