Re: unique ID across all columns
- From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
- To: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
- Cc: Felix Kater <fkater(at)googlemail(dot)com>, pgsql-general(at)postgresql(dot)org
- Subject: Re: unique ID across all columns
- Date: Tue, 17 Apr 2007 11:12:56 -0400
- Message-id: <22258(dot)1176822776(at)sss(dot)pgh(dot)pa(dot)us>
Alvaro Herrera <alvherre(at)commandprompt(dot)com> writes:
> Felix Kater wrote:
>> I need a unique ID across all columns I create. Is it o.k. to
>> achive this by combining pg_attribute.attnum of a column together with
>> the OID of the table the column is in?
> Yes, the table OID is unique, and pg_attribute.attnum is unique as well.
> They are not reused, not even when columns are dropped.
The OID could be re-used after the table is dropped, though. It's not
clear whether Felix needs uniqueness across time or just at any one
instant.
regards, tom lane
Home |
Main Index |
Thread Index