Re: pg_attribute table - Mailing list pgsql-novice

From Tom Lane
Subject Re: pg_attribute table
Date
Msg-id 22263.1106870601@sss.pgh.pa.us
Whole thread Raw
In response to pg_attribute table  (Afton & Ray Still <rastill@shaw.ca>)
List pgsql-novice
Afton & Ray Still <rastill@shaw.ca> writes:
> I'm trying to use information from the pg_attribute table, especially the
> atttypid and atttypmod columns.
> Can I count on these numbers to remain unchanged or do I need to cast them
> somehow, or get at this information some other way?

Well, for the built-in types: we're not in the habit of changing them,
but we reserve the right to do so.  For user-defined types: a
dump/reload will almost certainly assign new type OIDs.  So it depends
what you want to do and what time horizon you have for "unchanged".

If you would prefer to work with a textual type name then see
format_type(), which seems sadly undocumented but you use it like
format_type(atttypid, atttypmod).

            regards, tom lane

pgsql-novice by date:

Previous
From: Afton & Ray Still
Date:
Subject: pg_attribute table
Next
From: "Van Ingen, Lane"
Date:
Subject: Can't Get Going in psql