X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 85DD9329F85 for ; Thu, 14 Oct 2004 02:20:46 +0100 (BST) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 96164-07 for ; Thu, 14 Oct 2004 01:20:34 +0000 (GMT) Received: from mail63.csoft.net (leary3.csoft.net [63.111.22.74]) by svr1.postgresql.org (Postfix) with SMTP id 75AC7329F34 for ; Thu, 14 Oct 2004 02:20:32 +0100 (BST) Received: (qmail 18159 invoked by uid 1112); 13 Oct 2004 17:09:51 -0000 Date: Wed, 13 Oct 2004 12:09:51 -0500 (EST) From: Kris Jurka X-X-Sender: books@leary.csoft.net To: "Tornroth, Phill" Cc: pgsql-jdbc@postgresql.org Subject: Re: FW: Question about the postgres resultset implementation In-Reply-To: Message-ID: References: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.6 tagged_above=0.0 required=5.0 tests=DATE_IN_PAST_06_12 X-Spam-Level: X-Archive-Number: 200410/134 X-Sequence-Number: 11239 On Wed, 13 Oct 2004, Tornroth, Phill wrote: > I did some tinkering of my own and found that one of the problems with > making the driver less cumbersome is the fact that findColumn() is currently > case insensitive. I don't know if this is required by the jdbc spec, but it > seems all the field names come back lower case (in the fields[] array), and > so I could replace the implementation without understanding how to prevent > the case of the field names from changing (changing from the case they were > sent in as). Case insensitivity is required. Note that field names won't come back in lowercase if they aren't created as lowercase. Postgresql folds all non-quoted identifiers to lower case, so you need to quote them to retain case. > > At any rate, if case insensitivity could be thrown out then a very fast > implementation could be worked out. As is, the following code was a marked > improvement: I believe Peter's suggestion was to use a hashmap to cache the string->index mapping so that findColumn would only need to do the equalsIgnoreCase on the first call of that string, meaning once per column instead of for every call. Kris Jurka