Re: pg_attribute table

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Afton & Ray Still <rastill(at)shaw(dot)ca>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: pg_attribute table
Date: 2005-01-28 00:03:21
Message-ID: 22263.1106870601@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Afton & Ray Still <rastill(at)shaw(dot)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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Van Ingen, Lane 2005-01-28 00:48:22 Can't Get Going in psql
Previous Message Afton & Ray Still 2005-01-27 21:05:19 pg_attribute table