| From: | Kris Jurka <books(at)ejurka(dot)com> |
|---|---|
| To: | "Tornroth, Phill" <ptornroth(at)intellidot(dot)net> |
| Cc: | pgsql-jdbc(at)postgresql(dot)org |
| Subject: | Re: FW: Question about the postgres resultset implementation |
| Date: | 2004-10-13 17:09:51 |
| Message-ID: | Pine.BSO.4.56.0410131205480.22508@leary.csoft.net |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-jdbc |
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
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Kris Jurka | 2004-10-13 17:22:03 | Re: tightening up on use of oid 0 |
| Previous Message | Aaron Mulder | 2004-10-13 15:51:30 | Free PostgreSQL Training, Philadelphia, Oct 30 |