Oliver Jowett <oliver@opencloud.com> writes:
> I am wondering if the right way to find the array OID is to prepend "_"
> and search on pg_type.typname, or to look for pg_type.typinput = (oid of
> array_in) and pg_type.typelem = (oid of underlying type). Is there a
> 'standard' way of finding an array type OID?
The backend does it by name, ie prepend '_' and lookup by typname (and
typnamespace). This is a mite unclean but it hasn't seemed worth
fixing. If you like you can use the typelem as an additional check that
you found the right thing.
regards, tom lane