Database and table name case sensitivity

Поиск
Список
Период
Сортировка
От Ben Leslie
Тема Database and table name case sensitivity
Дата
Msg-id 20010209112347.A2889@sesgroup.net
обсуждение исходный текст
Ответы Re: Database and table name case sensitivity  ("Anthony E . Greene" <agreene@pobox.com>)
Re: Database and table name case sensitivity  (Peter T Mount <peter@retep.org.uk>)
Список pgsql-general
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 call CREATE TABLE using the mixed case table name I want eg:

CREATE TABLE BaseObject (trivial int4);

From this I can do:

SELECT * from BaseObject - or
SELECT * from baseobject .

This is case insensitive here.

The problem I run into is that I want to later rebuild object from the
database dynamically and this requires querying the system tables.

SELECT relname from pg_class where relname not like 'pg%';

This returns the names in lower case only.

I am wondering if there is any reason that this case information is
discarded when creating tables?

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

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

Thanks for any help you can provide.

Cheers,

Ben Leslie

(Should this goto the hackers list??)

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

Предыдущее
От: Joseph Shraibman
Дата:
Сообщение: Re: Auto-timestamp generator (attached)
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Auto-timestamp generator (attached)