OID or new relfilenode. If the existing OIDs are sufficiently densely
populated, this could take a long time (perhaps even be an infinite loop),
so it seems wise to allow the system to respond to a cancel interrupt here.
Per a gripe from Jacky Leng.
Backpatch as far as 8.1. Older versions just fail on OID collision,
instead of looping.
/* Generate new OIDs until we find one not in the table */
do
{
+ CHECK_FOR_INTERRUPTS();
+
newOid = GetNewObjectId();
ScanKeyInit(&key,
do
{
+ CHECK_FOR_INTERRUPTS();
+
/* Generate the OID */
if (pg_class)
rnode.relNode = GetNewOid(pg_class);