Re: Propose: enum with all registered table names? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Propose: enum with all registered table names?
Date
Msg-id 49259874.6000800@archonet.com
Whole thread Raw
In response to Propose: enum with all registered table names?  ("Dmitry Koterov" <dmitry@koterov.ru>)
Responses Re: Propose: enum with all registered table names?
List 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 by date:

Previous
From: "Dmitry Koterov"
Date:
Subject: Propose: enum with all registered table names?
Next
From: Bruce Momjian
Date:
Subject: Re: compiling libpq.dll with Borland C++, is it possible?