Re: column headers all in upper-case letters?

From: Frank Bax <fbax(at)sympatico(dot)ca>
To: "Sammer Reinhard J(dot)" <RSammer(at)mlink(dot)co(dot)at>
Cc: "'Rasmus Mohr'" <rmo(at)Netpointers(dot)com>, "'pgsql-novice(at)postgresql(dot)org'" <pgsql-novice(at)postgresql(dot)org>
Subject: Re: column headers all in upper-case letters?
Date: 2002-01-31 16:01:51
Message-ID: 3.0.6.32.20020131110151.02310c20@pop6.sympatico.ca
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sorry, I made a type in my previous example; so that it does not
demonstrate my point properly/clearly. It's subtle, look for it the
'create' statement and last select example.

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.

Browse pgsql-novice by date

  From Date Subject
Next Message Chris Thompson 2002-01-31 16:18:40 Re: column headers all in upper-case letters?
Previous Message Frank Bax 2002-01-31 15:53:47 Re: column headers all in upper-case letters?