@ -333,18 +333,18 @@ GetNewObjectId(void)
* iterations in GetNewOid . ) Note we are relying on unsigned comparison .
* iterations in GetNewOid . ) Note we are relying on unsigned comparison .
*
*
* During initdb , we start the OID generator at FirstBootstrapObjectId , so
* During initdb , we start the OID generator at FirstBootstrapObjectId , so
* we only enforce wrapping to that point when in bootstrap or standalone
* we only wrap if before that point when in bootstrap or standalone mode .
* mode . The first time through this routine after normal postmaster
* The first time through this routine after normal postmaster start , the
* start , the counter will be forced up to FirstNormalObjectId . This
* counter will be forced up to FirstNormalObjectId . This mechanism
* mechanism leaves the OIDs between FirstBootstrapObjectId and
* leaves the OIDs between FirstBootstrapObjectId and FirstNormalObjectI d
* FirstNormalObjectId available for automatic assignment during initdb ,
* available for automatic assignment during initdb , while ensuring they
* while ensuring they will never conflict with user - assigned OIDs .
* will never conflict with user - assigned OIDs .
*/
*/
if ( ShmemVariableCache - > nextOid < ( ( Oid ) FirstNormalObjectId ) )
if ( ShmemVariableCache - > nextOid < ( ( Oid ) FirstNormalObjectId ) )
{
{
if ( IsPostmasterEnvironment )
if ( IsPostmasterEnvironment )
{
{
/* wraparound in normal environment */
/* wraparound, or first post-initdb assignment, in normal mode */
ShmemVariableCache - > nextOid = FirstNormalObjectId ;
ShmemVariableCache - > nextOid = FirstNormalObjectId ;
ShmemVariableCache - > oidCount = 0 ;
ShmemVariableCache - > oidCount = 0 ;
}
}
@ -353,8 +353,8 @@ GetNewObjectId(void)
/* we may be bootstrapping, so don't enforce the full range */
/* we may be bootstrapping, so don't enforce the full range */
if ( ShmemVariableCache - > nextOid < ( ( Oid ) FirstBootstrapObjectId ) )
if ( ShmemVariableCache - > nextOid < ( ( Oid ) FirstBootstrapObjectId ) )
{
{
/* wraparound in standalone environment? */
/* wraparound in standalone mode (unlikely but possible) */
ShmemVariableCache - > nextOid = FirstBootstrap ObjectId ;
ShmemVariableCache - > nextOid = FirstNormal ObjectId ;
ShmemVariableCache - > oidCount = 0 ;
ShmemVariableCache - > oidCount = 0 ;
}
}
}
}