Re: Case sensitivity question . . .

From: Brent Verner <brent(at)rcfile(dot)org>
To: "Peter E(dot) Chen" <pchen3(at)jhmi(dot)edu>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Case sensitivity question . . .
Date: 2002-01-02 21:10:25
Message-ID: 20020102211025.GA13940@rcfile.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

[2002-01-02 15:21] Peter E. Chen said:
| Hey All,
|
| I'm trying to create new databases and tables. The database names and
| tables always end up in lower case. Is there a way to have some upper case
| letters in database and table names?

Yes, quote the names...

brent=# create table "A1" ( "SteakSauce" int );
CREATE
brent=# \d "A1"
Table "A1"
Attribute | Type | Modifier
------------+---------+----------
SteakSauce | integer |

Be aware that if you choose to use mixed case names, you must
/always/ quote them, which introduces just enough room for human
error that I'd not recommend using quoted names.

brent=# INSERT INTO A1 VALUES (1);
ERROR: Relation 'a1' does not exist
brent=# INSERT INTO "A1" VALUES (1);
INSERT 100155 1
brent=# SELECT * FROM A1;
ERROR: Relation 'a1' does not exist
brent=# SELECT * FROM "A1";
SteakSauce
------------
1
(1 row)

cheers.
brent

--
"Develop your talent, man, and leave the world something. Records are
really gifts from people. To think that an artist would love you enough
to share his music with anyone is a beautiful thing." -- Duane Allman

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Jeffrey W. Baker 2002-01-02 21:16:12 Re: Question on populating tables . . .
Previous Message Bryan White 2002-01-02 21:08:20 Re: Question on populating tables . . .