mirror of
https://github.com/postgres/postgres.git
synced 2026-02-19 02:29:10 -05:00
created in the bootstrap phase proper, rather than added after-the-fact by initdb. This is cleaner than before because it allows us to retire the undocumented ALTER TABLE ... CREATE TOAST TABLE command, but the real reason I'm doing it is so that toast tables of shared catalogs will now have predetermined OIDs. This will allow a reasonably clean solution to the problem of locking tables before we load their relcache entries, to appear in a forthcoming patch.
26 lines
796 B
Bash
Executable file
26 lines
796 B
Bash
Executable file
#!/bin/sh
|
|
#
|
|
# duplicate_oids
|
|
#
|
|
# $PostgreSQL: pgsql/src/include/catalog/duplicate_oids,v 1.8 2006/07/31 01:16:37 tgl Exp $
|
|
#
|
|
# finds manually-assigned oids that are duplicated in the system tables.
|
|
#
|
|
# run this script in src/include/catalog.
|
|
#
|
|
|
|
# note: we exclude BKI_BOOTSTRAP relations since they are expected to have
|
|
# matching DATA lines in pg_class.h
|
|
|
|
cat pg_*.h toasting.h indexing.h | \
|
|
egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
|
|
sed -n -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
|
|
-e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
|
|
-e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
|
|
-e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
|
|
-e 's/^DECLARE_TOAST([^,]*, *\([0-9][0-9]*\), *\([0-9][0-9]*\).*$/\1,\2/p' | \
|
|
tr ',' '\n' | \
|
|
sort -n | \
|
|
uniq -d
|
|
|
|
exit 0
|