Re: Question on datatypes returned for "select oid, typname from pg_type" - Mailing list pgsql-general

From Tom Lane
Subject Re: Question on datatypes returned for "select oid, typname from pg_type"
Date
Msg-id 4836.1331324119@sss.pgh.pa.us
Whole thread Raw
In response to Question on datatypes returned for "select oid, typname from pg_type"  (Alexander Reichstadt <lxr@mac.com>)
Responses Re: Question on datatypes returned for "select oid, typname from pg_type"  (Gavin Flower <GavinFlower@archidevsys.co.nz>)
List pgsql-general
Alexander Reichstadt <lxr@mac.com> writes:
> to find out what datatypes exist. When checking on a certain field, it
> returned 17 as a type, thus being a bytea. That's actually the
> question now, because, is it always that bytea gets oid 17 or are
> these assignments of type name and oid dependent on the database
> installation, version of pg or whatever else I might be missing?

The built-in data types have hand-assigned OIDs, as depicted in
src/include/catalog/pg_type.h.  While those aren't quite
guaranteed-frozen, we've never changed one that I can recall, and are
not very likely to in the future.  However, any type that's not built-in
has an OID that will vary across databases.  As a rule of thumb,
you could assume that any OID under 10000 is hand-assigned and won't
change.

            regards, tom lane

pgsql-general by date:

Previous
From: "Randy Ficker"
Date:
Subject: Re: 9.1 causing "out of shared memory" error and higher serialization conflicts
Next
From: "Francisco Figueiredo Jr."
Date:
Subject: Re: 9.1 causing "out of shared memory" error and higher serialization conflicts