Re: Database and table name case sensitivity - Mailing list pgsql-general

From Anthony E . Greene
Subject Re: Database and table name case sensitivity
Date
Msg-id 20010209004036.G953@cp5340
Whole thread Raw
In response to Database and table name case sensitivity  (Ben Leslie <benno@sesgroup.net>)
List pgsql-general
On Thu, 08 Feb 2001 19:23:47 Ben Leslie wrote:
>Just running into a few problems involving the case of table names.
>
>I am writing a program that dynamically maps python objects into
>postgres tables. These classes have mixed case names such as "BaseObject",
>"AbcXyzObject" etc.
>
>I call CREATE TABLE using the mixed case table name I want eg:
>
>CREATE TABLE BaseObject (trivial int4);

If you need to preserve the case, you will have to use double quotes when
creating and querying:

CREATE TABLE "BaseObject" (trivial int4);
SELECT * from "BaseObject";

This also applies to attributes (column names).

Tony
--
Anthony E. Greene <agreene@pobox.com> <http://www.pobox.com/~agreene/>
PGP Key: 0x6C94239D/7B3D BD7D 7D91 1B44 BA26  C484 A42A 60DD 6C94 239D
Chat:  AOL/Yahoo: TonyG05    ICQ: 91183266
Linux. The choice of a GNU Generation. <http://www.linux.org/>

pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: case insensitive unique index (part 2)
Next
From: "Thomas T. Thai"
Date:
Subject: Returned mail: see transcript for details (fwd)