Re: [GENERAL] searching oid's

Поиск
Список
Период
Сортировка
От Adriaan Joubert
Тема Re: [GENERAL] searching oid's
Дата
Msg-id 387ED2BA.2916CEB5@albourne.com
обсуждение исходный текст
Ответ на Re: [GENERAL] searching oid's  (admin <admin@wtbwts.com>)
Список pgsql-general
admin wrote:

> Actually, I think pg_dump with the -o flag keeps oid's, therefore allowing
> me to keep referential integrity after backup.
>
> > Using oid's is not a good idea, as they don't automatically get dumped with
> > pg_dump. And once your referential integrity gets screwed up and you are
> > using oid's you are really in a mess, as you cannot change oids. Use a serial
> > field to generate a key for every row, which generates you a sequence of
> > integers. It is much better than oids at a cost of 4 bytes.

Yes oids get dumped with the -o flag. That is why I said automatically. Fact
remains that you cannot manipulate oids. Should you ever want to copy a table into
an exisiting system you would have to do a new initdb to make sure that the oids
in your table are not in use. And if anything ever gets corrupted it is much
harder to recover and fix it, as you have no control over the oid values that the
system assigns. I would definitely recommend a separate serial value, and I
believe this is also what is recommended in the postgres docs.

Adriaan


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

Предыдущее
От: The Hermit Hacker
Дата:
Сообщение: Re: [GENERAL] Database synchronisation over the internet...
Следующее
От: Borek Lupomesky
Дата:
Сообщение: Does patch for GROUP BY/aggr. bug exist?