~ubuntu-branches/ubuntu/hardy/postgresql-8.4/hardy-backports

« back to all changes in this revision

Viewing changes to src/include/catalog/duplicate_oids

  • Committer: Bazaar Package Importer
  • Author(s): Martin Pitt
  • Date: 2009-03-20 12:00:13 UTC
  • Revision ID: james.westby@ubuntu.com-20090320120013-hogj7egc5mjncc5g
Tags: upstream-8.4~0cvs20090328
ImportĀ upstreamĀ versionĀ 8.4~0cvs20090328

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh
 
2
#
 
3
# duplicate_oids
 
4
#
 
5
# $PostgreSQL$
 
6
#
 
7
# finds manually-assigned oids that are duplicated in the system tables.
 
8
#
 
9
# run this script in src/include/catalog.
 
10
#
 
11
 
 
12
# note: we exclude BKI_BOOTSTRAP relations since they are expected to have
 
13
# matching DATA lines in pg_class.h
 
14
 
 
15
cat pg_*.h toasting.h indexing.h | \
 
16
egrep -v -e '^CATALOG\(.*BKI_BOOTSTRAP' | \
 
17
sed -n  -e 's/^DATA(insert *OID *= *\([0-9][0-9]*\).*$/\1/p' \
 
18
        -e 's/^CATALOG([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
 
19
        -e 's/^DECLARE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
 
20
        -e 's/^DECLARE_UNIQUE_INDEX([^,]*, *\([0-9][0-9]*\).*$/\1/p' \
 
21
        -e 's/^DECLARE_TOAST([^,]*, *\([0-9][0-9]*\), *\([0-9][0-9]*\).*$/\1,\2/p' | \
 
22
tr ',' '\n' | \
 
23
sort -n | \
 
24
uniq -d
 
25
 
 
26
exit 0