Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitca1e64f

Browse files
committed
Improve comment in GetNewObjectId().
The previous comment gave the impression that skipping OIDs beforeFirstNormalObjectId was merely an optimization to avoid likely collisions.In fact other parts of the system have been relying on this threshold todetect system-created objects since commit8e18d04, so adjust thewording.Author: Thomas MunroReviewed-by: Tom LaneDiscussion:https://postgr.es/m/CAEepm%3D33JASACeOayr_W3%3DCSjy2jiPxM-k89axu0akFbHdjnjA%40mail.gmail.com
1 parentab7dbd6 commitca1e64f

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

‎src/backend/access/transam/varsup.c‎

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,11 +476,9 @@ GetNewObjectId(void)
476476

477477
/*
478478
* Check for wraparound of the OID counter. We *must* not return 0
479-
* (InvalidOid); and as long as we have to check that, it seems a good
480-
* idea to skip over everything below FirstNormalObjectId too. (This
481-
* basically just avoids lots of collisions with bootstrap-assigned OIDs
482-
* right after a wrap occurs, so as to avoid a possibly large number of
483-
* iterations in GetNewOid.) Note we are relying on unsigned comparison.
479+
* (InvalidOid), and in normal operation we mustn't return anything below
480+
* FirstNormalObjectId since that range is reserved for initdb (see
481+
* IsCatalogClass()). Note we are relying on unsigned comparison.
484482
*
485483
* During initdb, we start the OID generator at FirstBootstrapObjectId, so
486484
* we only wrap if before that point when in bootstrap or standalone mode.

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp