Received: from magus.postgresql.org ([87.238.57.229]) by malur.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWNEg-0003K3-Ow for pgsql-jdbc@postgresql.org; Thu, 08 Nov 2012 08:13:14 +0000 Received: from outmail149113.authsmtp.com ([62.13.149.113]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1TWNEc-0000Ry-P9 for pgsql-jdbc@postgresql.org; Thu, 08 Nov 2012 08:13:14 +0000 Received: from mail-c194.authsmtp.com (mail-c194.authsmtp.com [62.13.128.121]) by punt5.authsmtp.com (8.14.2/8.14.2/Kp) with ESMTP id qA88D8PI067914; Thu, 8 Nov 2012 08:13:08 GMT Received: from ayaki.localdomain (124-148-90-153.dyn.iinet.net.au [124.148.90.153]) (authenticated bits=0) by mail.authsmtp.com (8.14.2/8.14.2) with ESMTP id qA88Cx5T007793 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Thu, 8 Nov 2012 08:13:03 GMT Message-ID: <509B698B.1040903@2ndQuadrant.com> Date: Thu, 08 Nov 2012 16:12:59 +0800 From: Craig Ringer Organization: 2nd Quadrant User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:16.0) Gecko/20121016 Thunderbird/16.0.1 MIME-Version: 1.0 To: Amila De Silva CC: pgsql-jdbc@postgresql.org Subject: Re: Error while returning auto-generated values References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit X-Server-Quench: 1eb909d1-297c-11e2-80b9-0022640b883e X-AuthReport-Spam: If SPAM / abuse - report it at: http://www.authsmtp.com/abuse X-AuthRoute: OCdxZQATClZeVg0b BQteCiN5VAwpPBRK HVkIKg5MJUcNSQVJ NksadBtFaA1bY1ZH HGQLWlZEUFV7WGB/ aw4fbAdZfEtKVxtj UFZIR1FNFgBqBAMA SF9vWhEBPwAieH53 Yk9hEHVfXkU0dBMv S05dQWwbZ25nO30e URVaagtUIgpXfh9H aFZ7VCEFaWZSKBg1 TUcAHRwbFgAXBT5P RRtFMlITRUtDBDMg WgoEHDMgVUQYWyJ2 IBEgJ0QVAEsdels7 NUYsQjoA X-Authentic-SMTP: 61633235383639.1015:706 X-AuthFastPath: 0 (Was 255) X-AuthSMTP-Origin: 124.148.90.153/2525 X-AuthVirus-Status: No virus detected - but ensure you scan with your own anti-virus system. X-Pg-Spam-Score: -2.6 (--) X-Archive-Number: 201211/29 X-Sequence-Number: 23496 On 11/08/2012 04:00 PM, Amila De Silva wrote: > > Simply by changing the case of SUBSCRIBER_ID to lower case, in return > column array ,this error can be avoided. But the problem is that > change is not feasible. Yes, that's how it works. It's nothing to do with JDBC, you'll get the same result if you run the query directly in psql. "DOUBLE QUOTED" identifiers are case-preserving, while unquoted identifiers are downcased. This means that you must quote consistently - everywhere, or nowhere. PgJDBC does not have a parameter to control this behaviour because PostgreSQL does not have a parameter to control it. PgJDBC can hardly parse all your SQL and add or remove quoting - in fact, attempting to do so could be very dangerous and even lead to security vulnerabilities. > Is it possible to solve this problem by changing the DDL statement or > any connection parameters? Yes, you need to change the DDL so that it also "DOUBLE QUOTES" identifiers if they are "DOUBLE QUOTED" when used in queries. If your queries use a mix of unquoted and quoted values, or mix of cases, then you're going to have go to through and fix them all to be consistent. -- Craig Ringer