| | |
| | | |
| | | select c.relname as "tab", cast(obj_description(c.oid) as varchar) as "desc", a.attnum as "num", a.attname as "col",atthasdef, |
| | | concat_ws('', t.typname, SUBSTRING(format_type(a.atttypid, a.atttypmod) from '(.*)')) as "type", d.description as "bak" |
| | | select * |
| | | -- select * |
| | | from pg_attribute a left join pg_description d on d.objoid = a.attrelid and d.objsubid = a.attnum left join pg_class c |
| | | on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in (135502,69701) |
| | | on a.attrelid = c.oid left join pg_type t on a.atttypid = t.oid where a.attnum >= 0 and reltype>0 and relnamespace in (29257,20582)--135502,69701 |
| | | order by c.relname desc, a.attnum asc; |
| | | |
| | | select pg_constraint.conname as pk_name,pg_attribute.attname as colname,pg_type.typname as typename from |