git.postgresql.org Git - postgresql.git/commitdiff

git projects / postgresql.git / commitdiff
? search:
summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: ab7dbd6)
Improve comment in GetNewObjectId().
2018年8月16日 05:17:30 +0000 (17:17 +1200)
2018年8月16日 05:17:30 +0000 (17:17 +1200)
The previous comment gave the impression that skipping OIDs before
FirstNormalObjectId was merely an optimization to avoid likely collisions.
In fact other parts of the system have been relying on this threshold to
detect system-created objects since commit 8e18d04d4da, so adjust the
wording.

Author: Thomas Munro
Reviewed-by: Tom Lane
Discussion: https://postgr.es/m/CAEepm%3D33JASACeOayr_W3%3DCSjy2jiPxM-k89axu0akFbHdjnjA%40mail.gmail.com


diff --git a/src/backend/access/transam/varsup.c b/src/backend/access/transam/varsup.c
index 394843f7e91768c7db048c19c65d32f9f6d8b553..cede579d7319fa18c03a25ad15245b0038251c9e 100644 (file)
--- a/src/backend/access/transam/varsup.c
+++ b/src/backend/access/transam/varsup.c
@@ -476,11 +476,9 @@ GetNewObjectId(void)
/*
* Check for wraparound of the OID counter. We *must* not return 0
- * (InvalidOid); and as long as we have to check that, it seems a good
- * idea to skip over everything below FirstNormalObjectId too. (This
- * basically just avoids lots of collisions with bootstrap-assigned OIDs
- * right after a wrap occurs, so as to avoid a possibly large number of
- * iterations in GetNewOid.) Note we are relying on unsigned comparison.
+ * (InvalidOid), and in normal operation we mustn't return anything below
+ * FirstNormalObjectId since that range is reserved for initdb (see
+ * IsCatalogClass()). Note we are relying on unsigned comparison.
*
* During initdb, we start the OID generator at FirstBootstrapObjectId, so
* we only wrap if before that point when in bootstrap or standalone mode.
This is the main PostgreSQL git repository.
RSS Atom

AltStyle によって変換されたページ (->オリジナル) /