Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group