Re: OID of type by name. - Mailing list pgsql-general

From Tom Lane
Subject Re: OID of type by name.
Date
Msg-id 14659.1291820273@sss.pgh.pa.us
Whole thread Raw
In response to Re: OID of type by name.  (Dmitriy Igrishin <dmitigr@gmail.com>)
Responses Re: OID of type by name.
List pgsql-general
Dmitriy Igrishin <dmitigr@gmail.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

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: Maximum size for char or varchar with limit
Next
From: Dmitriy Igrishin
Date:
Subject: Re: OID of type by name.