Re: Case sensitivity question . . . - Mailing list pgsql-general

From Brent Verner
Subject Re: Case sensitivity question . . .
Date
Msg-id 20020102211025.GA13940@rcfile.org
Whole thread Raw
In response to Case sensitivity question . . .  ("Peter E. Chen" <pchen3@jhmi.edu>)
List 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

pgsql-general by date:

Previous
From: "Bryan White"
Date:
Subject: Re: Case sensitivity question . . .
Next
From: Andrew Gould
Date:
Subject: Re: Question on populating tables . . .