Обсуждение: Auto-lowercasing of column names?

Поиск
Список
Период
Сортировка

Auto-lowercasing of column names?

От
Hakan Tandogan
Дата:
Hi,
I'm sending this to -hackers instead of -users because I think I'm
asking for a new feature in psql.
My Problem: If I run a sql file with create-table-statements through
psql, all the column names get automagically lowercased. On the other hand, the
Object-Relational-Mapping tool I'm using recreates all its objects from a
ResultSet, getting the lowercase names, and compares them with uppercase ones,
thus failing silently.
I'm working around this issue by enclosing the column names in ",
leading to slightly ugly ddl files (create table USERROLE ("ROLEID" serial
PRIMARY KEY, "PERMISSION" varchar);) and the necessity to change the default
data files (enclosing column names in insert statements with ").
Would it be possible to add a flag to psql, telling it to accept the
column names as they are in the ddl file?

Regards,    Hakan


-- 
Hakan Tandogan                                       hakan@iconsult.com

ICONSULT Tandogan - Egerer GbR                   Tel.: +49-9131-9047-0
Memelstrasse 38 - D-91052 Erlangen               Fax.: +49-9131-9047-77

"Any sufficiently advanced bug is indistinguishable from a feature"


Re: [HACKERS] Auto-lowercasing of column names?

От
Peter Eisentraut
Дата:
This is standard, documented behaviour. No way we can change that. Is
there a reason why your front-end tools cannot compare the names
case-insensitively?

On Mon, 17 Jan 2000, Hakan Tandogan wrote:

> 
>     Hi,
> 
>     I'm sending this to -hackers instead of -users because I think I'm
> asking for a new feature in psql.
> 
>     My Problem: If I run a sql file with create-table-statements through
> psql, all the column names get automagically lowercased. On the other hand, the
> Object-Relational-Mapping tool I'm using recreates all its objects from a
> ResultSet, getting the lowercase names, and compares them with uppercase ones,
> thus failing silently.
> 
>     I'm working around this issue by enclosing the column names in ",
> leading to slightly ugly ddl files (create table USERROLE ("ROLEID" serial
> PRIMARY KEY, "PERMISSION" varchar);) and the necessity to change the default
> data files (enclosing column names in insert statements with ").
> 
>     Would it be possible to add a flag to psql, telling it to accept the
> column names as they are in the ddl file?
> 
> 
>     Regards,
>         Hakan
> 
> 
> 

-- 
Peter Eisentraut                  Sernanders vaeg 10:115
peter_e@gmx.net                   75262 Uppsala
http://yi.org/peter-e/            Sweden



Re: [HACKERS] Auto-lowercasing of column names?

От
Hakan Tandogan
Дата:
On Mon, 17 Jan 2000, you wrote:
> This is standard, documented behaviour. No way we can change that. Is
Thus, a flag to psql, per default keeping the documented behaviour like
it is.

> there a reason why your front-end tools cannot compare the names
> case-insensitively?
Yes and No. They (the authors) told me to change my ddl scripts. The
bad part is that I can't modify them automatically (except by writing a full SQL
parser ;-) ). Thus, I have to watch for changes to the database schemas / data
and modify my own ddl scripts accordingly. While not a full-time-job by itself,
this solutions simply struck me as "not beautiful (tm)". Well, I guess I can
live a little longer with hand-modifying the ddl files ;-).
Regards,    Hakan

-- 
Hakan Tandogan                                       hakan@iconsult.com

ICONSULT Tandogan - Egerer GbR                   Tel.: +49-9131-9047-0
Memelstrasse 38 - D-91052 Erlangen               Fax.: +49-9131-9047-77

"Any sufficiently advanced bug is indistinguishable from a feature"