Re: Utility of OIDs in postgres

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Utility of OIDs in postgres
Дата
Msg-id 20070503070040.GB14495@svana.org
обсуждение исходный текст
Ответ на Re: Utility of OIDs in postgres  (Brent Wood <b.wood@niwa.co.nz>)
Список pgsql-general
On Thu, May 03, 2007 at 10:58:38AM +1200, Brent Wood wrote:
> As oid is unique across all tables (in fact all database objects), but
> serial is unique within a table, there are odd cases like this where
> using an oid in each table ensures an automatic unique key in the view.
> So oids can be useful.

As pointed out already, this isn't true. However, for the case you
provide you can also use tableoid which uniquely identifies the table.
Thus the combination of a serial primary and table oid is unique across
a single DB.

Have a nice day,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> From each according to his ability. To each according to his ability to litigate.

Вложения

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

Предыдущее
От: "Magnus Hagander"
Дата:
Сообщение: Re: C functions under windows
Следующее
От: Alban Hertroys
Дата:
Сообщение: Re: Update violating constraint