apple=# select * from (select a.relname, char_length(a.relname) as tb_name_length, b.attname, char_length(b.attname) as att_name_length, d.typname, b.attlen, b.attnum from pg_class a, pg_attribute b ,pg_tables c , pg_type d where b.attrelid = a.oid a