Re: Database and table name case sensitivity

From: Peter T Mount <peter(at)retep(dot)org(dot)uk>
To: benno(at)sesgroup(dot)net, Ben Leslie <benno(at)sesgroup(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Database and table name case sensitivity
Date: 2001-02-09 08:33:07
Message-ID: 981707587.3a83ab439a1fa@webmail.retep.org.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Quoting Ben Leslie <benno(at)sesgroup(dot)net>:

> Hi all,
>
> 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 am wondering if there is any reason that this case information is
> discarded when creating tables?

I think it's part of one of the SQL specs. Most DB's either map to lower case,
some to upper case, some keep the case but ignore it.

This happens enough that when Sun did the original JDBC spec they included
methods to check what scheme the backend actually uses...

> Is there any neat ways around it that don't involve me having to
> maintain my own
> table list?

No. Quote the names, eg:

select * from "BaseObject";
create table "BaseObject" ( ... ) ;

>
> If I patched postgres to store table names in a case sensitive way would
> it be accepted, what problems would this introduce?

It would probably blow up every app currently in existence ;-)

Peter

--
Peter Mount peter(at)retep(dot)org(dot)uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ben Leslie 2001-02-09 09:00:10 Re: Database and table name case sensitivity
Previous Message Poul L. Christiansen 2001-02-09 06:49:11 Re: TOAST