Re: unique ID across all columns

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: unique ID across all columns
Дата
Msg-id 22258.1176822776@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: unique ID across all columns  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Alvaro Herrera <alvherre@commandprompt.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

В списке pgsql-general по дате отправления:

Предыдущее
От: Mageshwaran
Дата:
Сообщение: Incremental backups
Следующее
От: Ketema
Дата:
Сообщение: Re: Dynamic DDL