Re: Column name case conversion

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: Zeljko Trogrlic <zeljko(at)technologist(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Column name case conversion
Date: 2000-09-09 00:22:22
Message-ID: Pine.BSF.4.10.10009081715450.99939-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


Sorry I didn't respond sooner -- lost the thread. :(

Yeah, I can see where you're seeing this now. Not so much
in the queries as in the code that needs to access the
results.

Your suggestion would work (theoretically the server could do
something similar in reverse (store a real name and lower cased
name for comparison)) Although, it might cause some wierdness
with quoted identifiers then...
Imagining someone with ID and "ID" and how that would interact
and how to not break the backward compatibility.

On Tue, 5 Sep 2000, Zeljko Trogrlic wrote:

> Let's say you select * from table where ID = 1
> Then you want to put all column name/value pairs into HashMap:
>
> for (int columnNo = 1; columnNo <= md.getColumnCount(); ++columnNo) {
> String name = md.getColumnName(columnNo);
> map.put(name, rs.getObject(columnNo));
> }
>
> And later you want to retrieve that value:
> map.get("ID");
>
> You system fails because you got null value. The only solution I can think
> of is to use toUpper for keys and to store column names separately, if
> needed for update.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Rommel B. Abaya 2000-09-09 05:38:47 port from MSSQLServer to PostgreSQL
Previous Message Stephan Szabo 2000-09-08 23:47:03 Re: race conditions, intersect in subqueries