Re: Propose: enum with all registered table names?

Поиск
Список
Период
Сортировка
От Richard Huxton
Тема Re: Propose: enum with all registered table names?
Дата
Msg-id 49259874.6000800@archonet.com
обсуждение исходный текст
Ответ на Propose: enum with all registered table names?  ("Dmitry Koterov" <dmitry@koterov.ru>)
Ответы Re: Propose: enum with all registered table names?  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
Dmitry Koterov wrote:
>
> So it would be very useful if Postgres has a special, system ENUM (e.g.
> pg_catalog.table_names_enum) which holds names of all tables in the database
> (format: schema.table), and their elements are automatically renamed when a
> table is renamed.

Too late :-)

It's regclass you're after I think.

=> CREATE TABLE track_tables (t regclass);
=> INSERT INTO track_tables (t) VALUES ('"A"'::regclass);
INSERT 0 1
=> SELECT * FROM track_tables;
  t
-----
 "A"
(1 row)

=> ALTER TABLE "A" RENAME TO atable;
ALTER TABLE
=> SELECT * FROM track_tables;
   t
--------
 atable
(1 row)


--
  Richard Huxton
  Archonet Ltd

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

Предыдущее
От: "Dmitry Koterov"
Дата:
Сообщение: Propose: enum with all registered table names?
Следующее
От: Bruce Momjian
Дата:
Сообщение: Re: compiling libpq.dll with Borland C++, is it possible?