Regclass and quoted table names

Поиск
Список
Период
Сортировка
От Emmanuel Cecchet
Тема Regclass and quoted table names
Дата
Msg-id 49ADEBBB.2010108@asterdata.com
обсуждение исходный текст
Ответы Re: Regclass and quoted table names
Список pgsql-hackers
Hi all,

It looks like the behavior of regclass is not consistent when table 
names are quoted. The name is returned without the quotes if the name is 
lower case with eventual trailing numbers, otherwise it is returned with 
quotes.
See some examples here:

tpch=# CREATE VIEW test AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "test1" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "'test2'" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "testcolumnVIEW" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "testcolumnview" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW testcolumnVIEW2 AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "1test" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "1test2abc" AS SELECT * FROM customer;
CREATE VIEW
tpch=# CREATE VIEW "1test2" AS SELECT * FROM customer;
CREATE VIEW
tpch=# select c.oid , c.oid::regclass from pg_class c where c.relname 
like '%test%'; oid  |       oid       
-------+------------------16410 | test16413 | test116416 | "'test2'"16419 | "testcolumnVIEW"16422 | testcolumnview16425
|testcolumnview216428 | "1test2abc"16431 | "1test2"16434 | "1test"
 
(9 rows)


Is this a bug?
manu

-- 
Emmanuel Cecchet
Aster Data Systems
Web: http://www.asterdata.com



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

Предыдущее
От: Selena Deckelmann
Дата:
Сообщение: Make SIGHUP less painful if pg_hba.conf is not readable
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Regclass and quoted table names