Re: Database and table name case sensitivity

Поиск
Список
Период
Сортировка
От Peter T Mount
Тема Re: Database and table name case sensitivity
Дата
Msg-id 981707587.3a83ab439a1fa@webmail.retep.org.uk
обсуждение исходный текст
Ответ на Database and table name case sensitivity  (Ben Leslie <benno@sesgroup.net>)
Ответы Re: Database and table name case sensitivity  (Ben Leslie <benno@sesgroup.net>)
Список pgsql-general
Quoting Ben Leslie <benno@sesgroup.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@retep.org.uk
PostgreSQL JDBC Driver: http://www.retep.org.uk/postgres/
RetepPDF PDF library for Java: http://www.retep.org.uk/pdf/

В списке pgsql-general по дате отправления:

Предыдущее
От: "Poul L. Christiansen"
Дата:
Сообщение: Re: TOAST
Следующее
От: Ben Leslie
Дата:
Сообщение: Re: Database and table name case sensitivity