Re: Column name case conversion
От | Zeljko Trogrlic |
---|---|
Тема | Re: Column name case conversion |
Дата | |
Msg-id | 4.1.20000909193250.0186b228@192.168.0.7 обсуждение исходный текст |
Ответ на | Re: Column name case conversion (Zeljko Trogrlic <zeljko@technologist.com>) |
Ответы |
Re: Column name case conversion
|
Список | 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. > >
В списке pgsql-general по дате отправления: