The method of table structure query in GP database:
Select D.nspname
, Obj_description (d.oid)
, C.relname
, Obj_description (c.oid)
, A.attnum
, A.attname
, E.data_type
, Col_description (C.oid,a.attum)
, e.is_nullable
, case where E.data_type ~ ' character '
Then e.character_maximum_length| | ‘‘
where E.data_type ~ ' numeric '
Then ((' (' (' | | | E.numeric_precision) | | E.numeric_scale) | | ') '
Else '
End
From Pg_class
Left JOIN Pg_acctribute A
On a.atttypid = T.oid
Join Pg_namespace D
On d.oid = C.relnamespace
and d.nspname not like ' pg_% '
Join Information_schema.cloumns E
On c.relname = E.table_name::name
and A.attnum = E.ordinal_position
and e.table_schema::name = D.nspname
where C.relname!~ ' pg|prt '
and A.attnum > 0
ORDER BY D.nspname
, C.relname
, A.attnum
;
GP Database occupies table space
Select Pg_size_pretty (pg_relation_size (' schema_name.table_name '));
Select Pg_size_pretty (pg_database_size (' db_name '));
GP Database Notes-table structure query, table-occupied spatial query