]> granicus.if.org Git - postgresql/blob - src/include/catalog/duplicate_oids
Reorganize our CRC source files again.
[postgresql] / src / include / catalog / duplicate_oids
1 #!/usr/bin/perl
2
3 use strict;
4 use warnings;
5
6 BEGIN
7 {
8         @ARGV = (glob("pg_*.h"), qw(indexing.h toasting.h));
9 }
10
11 my %oidcounts;
12
13 while (<>)
14 {
15         next if /^CATALOG\(.*BKI_BOOTSTRAP/;
16         next
17           unless /^DATA\(insert *OID *= *(\d+)/
18                   || /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/
19                   || /^CATALOG\([^,]*, *(\d+)/
20                   || /^DECLARE_INDEX\([^,]*, *(\d+)/
21                   || /^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/
22                   || /^DECLARE_TOAST\([^,]*, *(\d+), *(\d+)/;
23         $oidcounts{$1}++;
24         $oidcounts{$2}++ if $2;
25 }
26
27 my $found = 0;
28
29 foreach my $oid (sort { $a <=> $b } keys %oidcounts)
30 {
31         next unless $oidcounts{$oid} > 1;
32         $found = 1;
33         print "$oid\n";
34 }
35
36 exit $found;