pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Kris Jurka <books@ejurka.com>
To: Tornroth, Phill <ptornroth@intellidot.net>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: FW: Question about the postgres resultset implementation
Date: Wed, 13 Oct 2004 12:09:51 -0500 (EST)
Message-ID: <Pine.BSO.4.56.0410131205480.22508@leary.csoft.net> (raw)
In-Reply-To: <BD92920D.12F1%ptornroth@intellidot.net>
References: <BD92920D.12F1%ptornroth@intellidot.net>



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



view thread (7+ messages)  latest in thread

Message-ID: <Pine.BSO.4.56.0410131205480.22508@leary.csoft.net>
Permalink:  ../Pine.BSO.4.56.0410131205480.22508@leary.csoft.net/
Also on:    postgresql.org/message-id/Pine.BSO.4.56.0410131205480.22508@leary.csoft.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: books@ejurka.com, ptornroth@intellidot.net
  Subject: Re: FW: Question about the postgres resultset implementation
  In-Reply-To: <Pine.BSO.4.56.0410131205480.22508@leary.csoft.net>
  References: <BD92920D.12F1%ptornroth@intellidot.net> <Pine.BSO.4.56.0410131205480.22508@leary.csoft.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox