Hello,
You can have the list of table names from pg_class such as
SELECT c.relname as "Name" ,
FROM pg_catalog.pg_class c
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
WHERE c.relkind IN ('r') AND n.nspname NOT IN ('pg_toast', 'pg_catalog', 'information_schema') ;
So, if you want to store all table names you can just create a view around the above query.
Also , the following is not a perfect solution; but I think it will work. You can join your table with pg_class to filter out tables which are Dropped
Regards
From: Richard Huxton <dev@archonet.com>
To: Michael Graham <mgraham@bloxx.com>
Cc: "pgsql-general@postgresql.org" <pgsql-general@postgresql.org>
Sent: Friday, April 26, 2013 5:21 PM
Subject: Re: [GENERAL] Table containing only valid table names