您可以使用pg_views
來獲得訪問量:
select schemaname, tablename from (
select schemaname, tablename from pg_tables union all
select schemaname, viewname from pg_views
) as x
order by tablename
然後使用information_schema.columns
讓所有的列。例如:
select
schemaname,
tablename,
(
select array_agg("column_name"::text)
from information_schema.columns
where
table_schema = x.schemaname and
table_name = x.tablename
)
from (
select schemaname, tablename from pg_tables union all
select schemaname, viewname from pg_views
) as x
order by tablename
information_schema
有一堆其他的東西,你可能會發現有用:http://www.postgresql.org/docs/9.1/static/information-schema.html