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

From Alexander Reichstadt
Subject Question on datatypes returned for "select oid, typname from pg_type"
Date
Msg-id B8D35EFE-1410-4F8C-815B-982171D2E7A9@mac.com
Whole thread Raw
Responses Re: Question on datatypes returned for "select oid, typname from pg_type"  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Hi all,

for an API I want to make some changes to, I need to know the datatype being used for a record's column. In fact the
entirerecord is to be transferred into a dictionary. From my web research I came to use 

select oid, typname from pg_type


to find out what datatypes exist. When checking on a certain field, it returned 17 as a type, thus being a bytea.
That'sactually the question now, because, is it always that bytea gets oid 17 or are these assignments of type name and
oiddependent on the database installation, version of pg or whatever else I might be missing? I would prefer to
hardcodehow these numbers are interpreted for performance reasons, so even if they do depend on other criteria, my next
questionwould be how often throughout pg-history did they change, if they do not depend on the individual installation. 

Thank you in advance for clarifying.

Alex

pgsql-general by date:

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