PostgreSQL查询数据库中所有的表:

SELECT
    pg_catalog.pg_relation_filenode(c.oid) as "Filenode",
    relname as "Table Name"
FROM pg_class c
    LEFT JOIN pg_catalog.pg_namespace n ON n.oid = c.relnamespace
    LEFT JOIN pg_catalog.pg_database d ON d.datname = 'postgres'
WHERE relkind IN ('r')
    AND n.nspname NOT IN ('pg_catalog', 'information_schema')
    AND n.nspname !~ '^pg_toast'
ORDER BY relname