By default, Postgresql will convert all table and column names to lower
case; both when you are creating the table and in sql statements that it
processes. To override this, the table and column names must be enclosed
in double quotes, both when the table is created and in all subsequent sql
statements.
fbax=# create table test ("ID" int, id int);
CREATE
fbax=# insert into test values(1,2);
INSERT 6096748 1
fbax=# select * from test;
ID | id
----+----
1 | 2
(1 row)
fbax=# select "ID" from test;
ID
----
1
(1 row)
fbax=# select id from test;
id
----
2
(1 row)
Frank
At 03:32 PM 1/31/02 +0100, Sammer Reinhard J. wrote:
>> SELECT id AS "ID" FROM test
>>
>> but why??
>
>sorry, I was not precise.
>
>I am looking for a server or driver side configuration option
>as I don't want to rewrite all my SQL statements (>3500).
>
>I am porting an application running on MsSQL/Oracle DBs.
>
>>> Could you please point me to the fine document where I can
>>> information
>>> regarding:
>>>
>>> Is there a way to force PostgreSQL or the jdbc Driver to
>>> return column
>>> headers all in upper-case letters?
>>>
>>> e.g. table test with column ID type int:
>>> I want that a 'select * from test;' returns 'ID' not 'id' as
>>> column header.