获取当前db中所有的表信息:
select * from pg_tables;
用户自定义的表,如果未经特殊处理,默认都是放在名为public的schema下
select tablename from pg_tables where schemaname='public'
postgres=# select tablename from pg_tables where schemaname='public'; tablename ----------- tb_test (1 行记录)
推荐: