Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3tgh-0000zi-Ky for pgsql-jdbc@arkaria.postgresql.org; Thu, 16 Jan 2014 20:37:15 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.80) (envelope-from ) id 1W3tgh-0004ke-4n for pgsql-jdbc@arkaria.postgresql.org; Thu, 16 Jan 2014 20:37:15 +0000 Received: from makus.postgresql.org ([2001:4800:7903:4::125]) by malur.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3tgg-0004kT-4x for pgsql-jdbc@postgresql.org; Thu, 16 Jan 2014 20:37:14 +0000 Received: from outbound.vnet-inc.com ([216.146.104.103]) by makus.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1W3tgY-0006rv-WA for pgsql-jdbc@postgresql.org; Thu, 16 Jan 2014 20:37:13 +0000 Received: from [192.168.157.132] (unknown [65.19.243.151]) by outbound.vnet-inc.com (Postfix) with ESMTP id 27B85790A; Thu, 16 Jan 2014 13:36:09 -0700 (MST) Message-ID: <52D84217.6050003@ttc-cmc.net> Date: Thu, 16 Jan 2014 13:33:27 -0700 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.13) Gecko/20100914 SeaMonkey/2.0.8 MIME-Version: 1.0 To: Thomas Kellerer , PostgreSQL JDBC Subject: Re: Performance improvement proposal. Removal of toLowerCase calls. References: <52D7FE5E.3050503@redhat.com> <52D83125.2020908@ttc-cmc.net> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Pg-Spam-Score: -1.9 (-) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-jdbc Precedence: bulk Sender: pgsql-jdbc-owner@postgresql.org Thomas Kellerer wrote: > Dave Cramer wrote on 16.01.2014 20:51: >> >> Are you sure ? This is in the resultset, so any column names should >> have come back from the db. >> Which means that they should come back in lower case anyway. >> >> create table foo >> ( >> "ID" integer, >> "Bar" varchar >> ); >> >> select * >> from foo; >> >> Should return ID and Bar as the column names. >> >> >> Exactly! While I haven't actually tested the code. The lines that >> Jeremy is referring to would seem to suggest that >> the return columns would be id and bar. >> >> Does anyone have time to test this ? > > The current driver returns this correctly for a ResultSet. > > Here is a "transcript" from running my application on the console > (easier to copy & paste than a screenshot) > > SQL Workbench/J console interface started. > Enter 'exit' to quit. > Enter 'WbHelp' for a list of SQL Workbench/J specific commands > Config directory: C:\Projects\sqlworkbench\conf > > SQL> wbconnect {Postgres}/WbTest; > Connection to "User=thomas, Schema=public, > URL=jdbc:postgresql://localhost/wbtest" successful > > thomas@wbtest/public> create table foo ("ID" integer, "Bar" varchar, > "FoBaR" varchar); > Table 'foo' created > thomas@wbtest/public> insert into foo values (1, 'foo', 'bar'); > INSERT executed successfully > 1 row affected > thomas@wbtest/public> select * from foo; > ID | Bar | FoBaR > ---+-----+------ > 1 | foo | bar > > (1 Row) > SELECT executed successfully > thomas@wbtest/public> > > All the various API calls in DatabaseMetaData do return identifiers in > the correct case as well. > This is also the type of results that I have observed in the past in testing. The tableMetaData.getColumnName(i) will also return back the correct mixed case result. Ex. from table below. 1 Host 2 Db 3 Username 4 select_priv Not only does this apply to columns but also to table names that are quoted Normally I use the following table to test such occurrences in my code. DROP TABLE IF EXISTS "keY_tAble2"; CREATE TABLE "keY_tAble2" ( "Host" char(60) NOT NULL default '', "Db" char(64) NOT NULL default '', "Username" char(16) NOT NULL default '', Select_priv boolean NOT NULL default TRUE, PRIMARY KEY ("Host","Db","Username") ); danap. -- Sent via pgsql-jdbc mailing list (pgsql-jdbc@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-jdbc