Re: general question on OIDs

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: general question on OIDs
Дата
Msg-id 26978.989123762@sss.pgh.pa.us
обсуждение исходный текст
Ответ на general question on OIDs  (Oliver Vecernik <vecernik@aon.at>)
Список pgsql-admin
Oliver Vecernik <vecernik@aon.at> writes:
> Using of OIDs as foreign keys is recommended in the docs.

Er ... where?  It shouldn't be.

> But what happens if I have to upgrade my server? For example for the new
> 7.1 release an initdb is required. OIDs start from 16384 or something.
> After importing my old databases can I expect that OIDs are not unique
> any more? Or is there any other handling to prevent this?

This is why it shouldn't be.  Reloading a pg_dump-with-OIDs will
probably yield a conflict-free database, but it's not certain;
and it is certain that you'll waste lots of OIDs that way.  Much
better to use serial columns for foreign keys.

            regards, tom lane

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

Предыдущее
От: Oliver Vecernik
Дата:
Сообщение: general question on OIDs
Следующее
От: Oliver Vecernik
Дата:
Сообщение: Re: general question on OIDs