2021
01-08
01-08
postgresql 实现获取所有表名,字段名,字段类型,注释
获取表名及注释:selectrelnameastabname,cast(obj_description(relfilenode,'pg_class')asvarchar)ascommentfrompg_classcwhererelkind='r'andrelnamenotlike'pg_%'andrelnamenotlike'sql_%'orderbyrelname过滤掉分表:加条件andrelchecks=0即可获取字段名、类型、注释、是否为空:SELECTcol_description(a.attrelid,a.attnum)ascomment,format_type(a.atttypid,a.atttypmod)astype,a.attname...
继续阅读 >