Dmitriy Igrishin <dmitigr(at)gmail(dot)com> writes:
>> How can I get OID by name rather than alias ?
> SELECT oid FROM pg_type WHERE typtype = 'b' AND typarray <> 0 AND
> typname::regtype = 'integer';
Seems like the hard way --- if you think carefully about what regtype
is doing, you'll realize that this is incredibly inefficient, as well
as a lot of typing. I usually do SELECT 'integer'::regtype::oid
when I need a quick numeric lookup.
regards, tom lane