Colton A Smith <smith(at)cs(dot)utk(dot)edu> writes:
> SELECT attname, typname, attnum
> FROM pg_attribute INNER JOIN pg_type
> ON pg_attribute.atttypid = pg_type.typelem
> WHERE pg_attribute.attrelid = $oid (derived above)
> AND NOT attisdropped;
I think you meant to join to pg_type.oid, not pg_type.typelem.
regards, tom lane