Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1a9i8d-0008Cb-N3 for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Dec 2015 23:39:11 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1a9i8d-0003gB-9h for pgsql-bugs@arkaria.postgresql.org; Thu, 17 Dec 2015 23:39:11 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1a9TTy-0006HQ-RC for pgsql-bugs@postgresql.org; Thu, 17 Dec 2015 08:00:14 +0000 Received: from mail.netcetera.ch ([194.126.145.7] helo=mail.netcetera.com) by makus.postgresql.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.84) (envelope-from ) id 1a9TTq-0003Y6-GQ for pgsql-bugs@postgresql.org; Thu, 17 Dec 2015 08:00:13 +0000 Received: from netcetera.com (smtp-int.netcetera.com [172.16.0.139]) by mail.netcetera.com (8.13.8/8.14.1) with ESMTP id tBH7uopY028196 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 17 Dec 2015 08:56:50 +0100 Received: from exchange01.one.nca (exchange01.one.nca [172.16.1.20]) by netcetera.com (8.13.8/8.14.1) with ESMTP id tBH7uolm022270; Thu, 17 Dec 2015 08:56:50 +0100 Received: from EXCHANGE01.one.nca (172.16.1.20) by exchange01.one.nca (172.16.1.20) with Microsoft SMTP Server (TLS) id 15.0.712.24; Thu, 17 Dec 2015 08:56:08 +0100 Received: from EXCHANGE01.one.nca ([fe80::b167:9768:7217:8762]) by exchange01.one.nca ([fe80::b167:9768:7217:8762%12]) with mapi id 15.00.0712.012; Thu, 17 Dec 2015 08:56:08 +0100 From: Daniel Kellenberger To: Joe Conway , "pgsql-bugs@postgresql.org" Subject: Re: json_to_recordset not working with camelcase json keys Thread-Topic: [BUGS] json_to_recordset not working with camelcase json keys Thread-Index: AQHRN4FAqJx2dV22Mkq8Ba2HedY50p7Mnb2AgAIzr/I= Date: Thu, 17 Dec 2015 07:56:08 +0000 Message-ID: <6f30a05b5a61458aa89c2d9b033aeb1a@exchange01.one.nca> References: <9e4b92c2c68d4c3b8c4cdf5aa11bc844@exchange01.one.nca>, <56709F85.1040003@joeconway.com> In-Reply-To: <56709F85.1040003@joeconway.com> Accept-Language: de-DE, en-US, de-CH Content-Language: de-DE X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.29] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-Pg-Spam-Score: -2.6 (--) 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 Hi Joe Thanks for your answer, this solved our issue. In one project we are currently switching from Oracle to PostgreSQL and are= excited about the database. Kind regards, Daniel --=20 Our software sets the course: http://nca.me/software Daniel Kellenberger | daniel.kellenberger@netcetera.com | T +41 44 297 58 1= 4 | Netcetera AG | 8040 Z=FCrich | Switzerland | http://netcetera.com |=20 ________________________________________ Von: Joe Conway Gesendet: Mittwoch, 16. Dezember 2015 00:17 An: Daniel Kellenberger; pgsql-bugs@postgresql.org Betreff: Re: [BUGS] json_to_recordset not working with camelcase json keys On 12/15/2015 01:46 PM, Daniel Kellenberger wrote: > We tried to extract from a json with camel case keys values, but > unfortunatelly they are not mapped. > > Testcase: (PostgreSQL 9.4.5) > > select * from > json_to_recordset('[{"aB":1,"bC":"foo"},{"aB":"2","cD":"bar"}]') as x(aB > int, bC text); Not a bug, I believe. You probably meant this: select * from json_to_recordset('[{"aB":1,"bC":"foo"}, {"aB":"2","cD":"bar"}]') as x("aB" int, "bC" text, "cD" text); aB | bC | cD ----+-----+----- 1 | foo | 2 | | bar (2 rows) Unquoted identifiers are lowercased in postgres, so for camel case identifiers you would need double quotes. HTH, Joe -- Crunchy Data - http://crunchydata.com PostgreSQL Support for Secure Enterprises Consulting, Training, & Open Source Development --=20 Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs