1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-22 12:22:45 +03:00

Create a separate oid range for oids assigned by genbki.pl.

The changes I made in 578b229718 assigned oids below
FirstBootstrapObjectId to objects in include/catalog/*.dat files that
did not have an oid assigned, starting at the max oid explicitly
assigned.  Tom criticized that for mainly two reasons:
1) It's not clear which values are manually and which explicitly
   assigned.
2) The space below FirstBootstrapObjectId gets pretty crowded, and
   some PostgreSQL forks have used oids >= 9000 for their own objects,
   to avoid conflicting.

Thus create a new range for objects not assigned explicit oids, but
assigned by genbki.pl. For now 1-9999 is for explicitly assigned oids,
FirstGenbkiObjectId (10000) to FirstBootstrapObjectId (1200) -1 is for
genbki.pl assigned oids, and < FirstNormalObjectId (16384) is for oids
assigned during bootstrap.  It's possible that we'll have to adjust
these boundaries, but there's some headroom for now.

Add a note suggesting that oids in forks should be assigned in the
9000-9999 range.

Catversion bump for obvious reasons.

Per complaint from Tom Lane.

Author: Andres Freund
Discussion: https://postgr.es/m/16845.1544393682@sss.pgh.pa.us
This commit is contained in:
Andres Freund
2018-12-13 14:50:57 -08:00
parent 84d514887f
commit 09568ec3d3
9 changed files with 47 additions and 33 deletions

View File

@@ -79,9 +79,9 @@ foreach my $datfile (@input_files)
}
# Fetch some values for later.
my $FirstBootstrapObjectId =
my $FirstGenbkiObjectId =
Catalog::FindDefinedSymbol('access/transam.h', $include_path,
'FirstBootstrapObjectId');
'FirstGenbkiObjectId');
my $INTERNALlanguageId =
Catalog::FindDefinedSymbolFromData($catalog_data{pg_language},
'INTERNALlanguageId');
@@ -252,13 +252,13 @@ const int fmgr_nbuiltins = (sizeof(fmgr_builtins) / sizeof(FmgrBuiltin));
# Create fmgr_builtins_oid_index table.
#
# Note that the array has to be filled up to FirstBootstrapObjectId,
# Note that the array has to be filled up to FirstGenbkiObjectId,
# as we can't rely on zero initialization as 0 is a valid mapping.
print $tfh qq|
const uint16 fmgr_builtin_oid_index[FirstBootstrapObjectId] = {
const uint16 fmgr_builtin_oid_index[FirstGenbkiObjectId] = {
|;
for (my $i = 0; $i < $FirstBootstrapObjectId; $i++)
for (my $i = 0; $i < $FirstGenbkiObjectId; $i++)
{
my $oid = $fmgr_builtin_oid_index[$i];
@@ -269,7 +269,7 @@ for (my $i = 0; $i < $FirstBootstrapObjectId; $i++)
$oid = 'InvalidOidBuiltinMapping';
}
if ($i + 1 == $FirstBootstrapObjectId)
if ($i + 1 == $FirstGenbkiObjectId)
{
print $tfh " $oid\n";
}