Postgresql获取数据库中所有table名:
SELECT tablename FROM pg_tables WHERE tablename NOT liKE 'pg%' AND tablename NOT liKE 'sql_%'ORDER BY tablename;
Postgresql获取数据库中所有table名及table的注解信息:
SELECT tablename,obj_description(relfilenode,'pg_class') FROM pg_tables a,pg_class bWHERE a.tablename = b.relnameand a.tablename NOT liKE 'pg%' AND a.tablename NOT liKE 'sql_%'ORDER BY a.tablename;
Postgresql获取指定table的所有字段信息:
SELECT col_description(a.attrelID,a.attnum) as comment,format_type(a.atttypID,a.atttypmod) as type,a.attname as name,a.attnotnull as notnullFROM pg_class as c,pg_attribute as awhere c.relname = 'tablename' and a.attrelID = c.oID and a.attnum>0总结
以上是内存溢出为你收集整理的PostgreSQL获取table名,字段名全部内容,希望文章能够帮你解决PostgreSQL获取table名,字段名所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)