1997-03-15 07:03:08 +01:00
|
|
|
#!/bin/sh
|
|
|
|
#
|
|
|
|
# duplicate_oids
|
|
|
|
#
|
2005-04-14 03:38:22 +02:00
|
|
|
# $PostgreSQL: pgsql/src/include/catalog/duplicate_oids,v 1.7 2005/04/14 01:38:20 tgl Exp $
|
1997-03-15 07:03:08 +01:00
|
|
|
#
|
2005-04-13 20:54:57 +02:00
|
|
|
# finds manually-assigned oids that are duplicated in the system tables.
|
2001-09-28 10:09:14 +02:00
|
|
|
#
|
2005-04-13 20:54:57 +02:00
|
|
|
# run this script in src/include/catalog.
|
2001-09-28 10:09:14 +02:00
|
|
|
#
|
|
|
|
|
2005-04-14 03:38:22 +02:00
|
|
|
# note: we exclude BKI_BOOTSTRAP relations since they are expected to have
|
|
|
|
# matching DATA lines in pg_class.h
|
2001-09-28 10:09:14 +02:00
|
|
|
|
2005-04-14 03:38:22 +02:00
|
|
|
cat pg_*.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' | \
|
|
|
|
sort -n | \
|
|
|
|
uniq -d
|
2001-09-28 10:09:14 +02:00
|
|
|
|
2005-04-13 20:54:57 +02:00
|
|
|
exit 0
|