Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XCw88-0002dT-SQ for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Jul 2014 19:35:12 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1XCw88-0006uT-3d for pgsql-bugs@arkaria.postgresql.org; Thu, 31 Jul 2014 19:35:12 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:DHE_RSA_AES_256_CBC_SHA256:256) (Exim 4.80) (envelope-from ) id 1XCsE7-0002FR-Uh for pgsql-bugs@postgresql.org; Thu, 31 Jul 2014 15:25:08 +0000 Received: from wrigleys.postgresql.org ([204.145.124.246]) by magus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1XCsE2-0008PD-R7 for pgsql-bugs@postgresql.org; Thu, 31 Jul 2014 15:25:06 +0000 MIME-Version: 1.0 Subject: BUG #11103: to_json() does not convert correctly DOMAINs type since 9.3.5 (int expected instead of string) ? To: pgsql-bugs@postgresql.org From: dgrelaud@ideolys.com Date: Thu, 31 Jul 2014 15:24:56 +0000 Message-ID: <20140731152456.2708.35688@wrigleys.postgresql.org> X-Pg-Spam-Score: -1.9 (-) Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit 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 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