Re: heap_create with OID?

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: heap_create with OID?
Дата
Msg-id 29283.962895341@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: heap_create with OID?  (Bruce Momjian <pgman@candle.pha.pa.us>)
Список pgsql-hackers
Bruce Momjian <pgman@candle.pha.pa.us> writes:
>> 2. Run the system long enough, the OID counter will wrap around and
>> start generating already-used numbers.

> Seems we should throw an error on rollover, or at least jump from 0 to
> 17k to skip the system oid's.  That zero oid is going to cause a
> problem, perhaps.

Throwing an error will definitely not do --- that'd mean your whole
installation comes to a screeching halt as soon as you hit 4G OIDs.
That cure is way worse than the disease...

We do need to avoid generating a zero OID.  I vaguely recall having
seen some code somewhere that did that, but it was pretty crude/ugly,
and I'm not even sure it was in the OID generator rather than in one
specific routine that used OIDs :-(.  (What I seem to recall having
seen was some code that called newoid() a second time if it got a zero.
This is bletcherous of course.)

As long as we've gotta avoid zero anyway, skipping over the whole
system-reserved range doesn't sound like a bad idea, even though it's
not going to guarantee anything.  But it's got to be done at the bottom
level of the counter-incrementing logic, not higher up.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: heap_create with OID?
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Alternative new libpq interface.