7 # finds blocks of manually-assignable oids that have not already been
8 # claimed by post_hackers. primarily useful for finding available
9 # oids for new internal functions. the numbers printed are inclusive
10 # ranges of unused oids.
12 # before using a large empty block, make sure you aren't about
13 # to take over what was intended as expansion space for something
16 # run this script in src/include/catalog.
22 # Get FirstBootstrapObjectId from access/transam.h
23 FIRSTOBJECTID
=`grep '#define[ ]*FirstBootstrapObjectId' ../access/transam.h | $AWK '{ print $3 }'`
26 # this part (down to the uniq step) should match the duplicate_oids script
27 # note: we exclude BKI_BOOTSTRAP relations since they are expected to have
28 # matching DATA lines in pg_class.h
30 cat pg_
*.h toasting.h indexing.h | \
31 egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
32 sed -n -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
33 -e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
34 -e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
35 -e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
36 -e 's/^DECLARE_TOAST([^,]*, *\([0-9][0-9]*\), *\([0-9][0-9]*\).*$/\1,\2/p' | \
47 print last + 1, "-", $1 - 1;
55 print last + 1, "-", ENVIRON["FIRSTOBJECTID"]-1;