Re: The unused_oids script should have a reminder to use the8000-8999 OID range - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: The unused_oids script should have a reminder to use the8000-8999 OID range
Date
Msg-id 20190806034721.GC32256@paquier.xyz
Whole thread Raw
In response to Re: The unused_oids script should have a reminder to use the8000-8999 OID range  (Julien Rouhaud <rjuju123@gmail.com>)
Responses Re: The unused_oids script should have a reminder to use the8000-8999 OID range  (Peter Geoghegan <pg@bowt.ie>)
List pgsql-hackers
On Mon, Aug 05, 2019 at 09:00:26PM +0200, Julien Rouhaud wrote:
> Thanks!

What you have committed does that:
+do
+{
+   $suggestion = int(8000 + rand(2000));
+} while (grep(/^$suggestion$/, @{$oids}));
So it would be possible to get 9998-9999 as suggestion.  In which
case, one can basically finish with this message:
Suggested random unused OID: 9999 (1 consecutive OID(s) available
starting here)

Wouldn't it be better to keep some room at the end of the allowed
array?  Or at least avoid suggesting ranges where there is less than
3-5 OIDs available consecutively.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Michael Paquier
Date:
Subject: Re: Assertion for logically decoding multi inserts into the catalog
Next
From: Michael Paquier
Date:
Subject: Re: pg can create duplicated index without any errors even warnning