summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
Diffstat (limited to 'src/include')
-rw-r--r--src/include/access/transam.h17
-rwxr-xr-xsrc/include/catalog/duplicate_oids39
-rwxr-xr-xsrc/include/catalog/unused_oids25
3 files changed, 26 insertions, 55 deletions
diff --git a/src/include/access/transam.h b/src/include/access/transam.h
index c169d8f321..20518fa383 100644
--- a/src/include/access/transam.h
+++ b/src/include/access/transam.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/access/transam.h,v 1.53 2005/02/20 21:46:50 tgl Exp $
+ * $PostgreSQL: pgsql/src/include/access/transam.h,v 1.54 2005/04/13 18:54:57 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -55,23 +55,24 @@
* OIDs 1-9999 are reserved for manual assignment (see the files
* in src/include/catalog/).
*
- * OIDS 10000-16383 are reserved for assignment by genbki.sh.
+ * OIDS 10000-16383 are reserved for assignment during initdb
+ * using the OID generator. (We start the generator at 10000.)
*
- * OIDs beginning at 16384 are assigned at runtime from the OID
- * generator. (The first few of these will be assigned during initdb,
- * to objects created after the initial BKI script processing.)
+ * OIDs beginning at 16384 are assigned from the OID generator
+ * during normal multiuser operation. (We force the generator up to
+ * 16384 as soon as we are in normal operation.)
*
* The choices of 10000 and 16384 are completely arbitrary, and can be moved
* if we run low on OIDs in either category. Changing the macros below
* should be sufficient to do this.
*
- * NOTE: if the OID generator wraps around, we should skip over OIDs 0-16383
+ * NOTE: if the OID generator wraps around, we skip over OIDs 0-16383
* and resume with 16384. This minimizes the odds of OID conflict, by not
* reassigning OIDs that might have been assigned during initdb.
* ----------
*/
-#define FirstGenBKIObjectId 10000
-#define BootstrapObjectIdData 16384
+#define FirstBootstrapObjectId 10000
+#define FirstNormalObjectId 16384
/*
* VariableCache is placed in shmem and used by
diff --git a/src/include/catalog/duplicate_oids b/src/include/catalog/duplicate_oids
index ebcea8f2ec..6ff75b4a3a 100755
--- a/src/include/catalog/duplicate_oids
+++ b/src/include/catalog/duplicate_oids
@@ -2,45 +2,18 @@
#
# duplicate_oids
#
-# finds oids that are duplicated in the system tables.
+# $PostgreSQL: pgsql/src/include/catalog/duplicate_oids,v 1.6 2005/04/13 18:54:57 tgl Exp $
#
-
-FILES=`ls pg_*.h`
-
+# finds manually-assigned oids that are duplicated in the system tables.
#
-# The previous version did not use the -d option on uniq
-# so check here that it is supported.
-# Otherwise, use the old algorithm
+# run this script in src/include/catalog.
#
-if [ `uniq -d < /dev/null > /dev/null 2>&1` ]; then
- echo "uniq -d is not supported on your platform."
- echo "Please report this to pgsql-hackers@postgresql.org"
-
-egrep '^DATA' $FILES | \
- sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \
- sort -n >/tmp/alloids.$$
-uniq /tmp/alloids.$$ >/tmp/uniqoids.$$
-
-diff -u /tmp/alloids.$$ /tmp/uniqoids.$$ | \
- grep -v '/tmp/' | \
- grep '^-' | \
- sed -e 's/^-//' | \
- grep -v '^0$' | \
- uniq
-rm /tmp/alloids.$$
-rm /tmp/uniqoids.$$
-
-else
-
-# echo "uniq -d is supported on this platform."
-# echo "Will omit the use of temporary files."
+FILES=`ls pg_*.h`
egrep '^DATA' $FILES | \
sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \
sort -n | uniq -d | \
- egrep -v '^[0]*$'
-
-fi
+ egrep -v '^0*$'
-exit
+exit 0
diff --git a/src/include/catalog/unused_oids b/src/include/catalog/unused_oids
index 897213a75c..b1ea971f3d 100755
--- a/src/include/catalog/unused_oids
+++ b/src/include/catalog/unused_oids
@@ -1,20 +1,17 @@
#!/bin/sh
+#
# unused_oids
#
-# $PostgreSQL: pgsql/src/include/catalog/unused_oids,v 1.5 2003/11/29 19:52:08 pgsql Exp $
+# $PostgreSQL: pgsql/src/include/catalog/unused_oids,v 1.6 2005/04/13 18:54:57 tgl Exp $
#
-# finds blocks of oids that have not already been claimed by
-# post_hackers for internal purposes. primarily useful for
-# finding valid oids for new internal function oids. the numbers
-# printed are inclusive ranges of valid (unused) oids.
+# finds blocks of manually-assignable oids that have not already been
+# claimed by post_hackers. primarily useful for finding available
+# oids for new internal functions. the numbers printed are inclusive
+# ranges of unused oids.
#
# before using a large empty block, make sure you aren't about
# to take over what was intended as expansion space for something
-# else. also, before using a number, do a "grepsrc" to make sure
-# that someone isn't using a literal numeric constant somewhere..
-#
-# non-berkeley post_hackers should probably not try to use oids
-# less than the highest one that comes with the distributed source.
+# else.
#
# run this script in src/include/catalog.
#
@@ -22,9 +19,9 @@
AWK="awk"
-# Get FirstGenBKIObjectId from access/transam.h
-BKIOBJECTID=`grep '#define[ ]*FirstGenBKIObjectId' ../access/transam.h | $AWK '{ print $3 }'`
-export BKIOBJECTID
+# Get FirstBootstrapObjectId from access/transam.h
+FIRSTOBJECTID=`grep '#define[ ]*FirstBootstrapObjectId' ../access/transam.h | $AWK '{ print $3 }'`
+export FIRSTOBJECTID
egrep '^DATA' pg_*.h | \
sed -e 's/^.*OID[^=]*=[^0-9]*//' -e 's/[^0-9].*$//' | \
@@ -45,5 +42,5 @@ BEGIN {
last = $1;
}
END {
- print last + 1, "-", ENVIRON["BKIOBJECTID"]-1;
+ print last + 1, "-", ENVIRON["FIRSTOBJECTID"]-1;
}'