postgres=# select oid,nspname from pg_namespace;
oid | nspname
-------+--------------------
99 | pg_toast
11 | pg_catalog
2200 | public
13238 | information_schema
32910 | squeeze
33042 | pg_toast_temp_3
33935 | pg_temp_3
(7 rows)
postgres=# select relname,
CASE c.relkind
WHEN 'r' THEN 'table'
WHEN 'i' THEN 'index'
WHEN 'S' THEN 'sequence'
WHEN 't' THEN 'TOAST table'
WHEN 'v' THEN 'view'
WHEN 'm' THEN 'materialized view'
WHEN 'c' THEN 'composite type'
WHEN 'f' THEN 'foreign table'
WHEN 'P' THEN 'partitioned table'
WHEN 'I' THEN 'partitioned index'
END as "Type",relnamespace
from pg_class c where relnamespace not in (11,13238,99,32910)
order by 2 desc
;
relname | Type | relnamespace
-------------------------+-------+--------------
pg_stat_statements | view | 2200
pg_stat_statements_info | view | 2200
t | table | 2200
tbl_article | table | 2200
dept | table | 2200
emp | table | 2200
stu | table | 2200
item | table | 2200
t1 | table | 2200
test1 | table | 2200
t_n | index | 2200
(11 rows)
|