From: | Zeljko Trogrlic <zeljko(at)technologist(dot)com> |
---|---|
To: | Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com> |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Column name case conversion |
Date: | 2000-09-09 17:44:04 |
Message-ID: | 4.1.20000909193250.0186b228@192.168.0.7 |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
First, having id and ID is a BAD naming practice.
Compatibility could be solved with compatibility flags. I guess this is not
the only place where PostgreSQL breaks compatibility (like any other database).
I remember milion of swithches when I worked with old Turbo c :(
At 02:22 9.9.2000 , Stephan Szabo wrote:
>
>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.
>
>
From | Date | Subject | |
---|---|---|---|
Next Message | Tim Kientzle | 2000-09-09 18:24:12 | Re: race conditions |
Previous Message | Tom Lane | 2000-09-09 16:59:47 | Re: [SQL] Porting from mysql to psql (UNIX_TIMESTAMP()?) |