postgresql/src/include/catalog/duplicate_oids
Bruce Momjian 0a78320057 pgindent run for 9.4
This includes removing tabs after periods in C comments, which was
applied to back branches, so this change should not effect backpatching.
2014-05-06 12:12:18 -04:00

36 lines
647 B
Perl
Executable file

#!/usr/bin/perl
use strict;
use warnings;
BEGIN
{
@ARGV = (glob("pg_*.h"), qw(indexing.h toasting.h));
}
my %oidcounts;
while (<>)
{
next if /^CATALOG\(.*BKI_BOOTSTRAP/;
next
unless /^DATA\(insert *OID *= *(\d+)/
|| /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/
|| /^CATALOG\([^,]*, *(\d+)/
|| /^DECLARE_INDEX\([^,]*, *(\d+)/
|| /^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/
|| /^DECLARE_TOAST\([^,]*, *(\d+), *(\d+)/;
$oidcounts{$1}++;
$oidcounts{$2}++ if $2;
}
my $found = 0;
foreach my $oid (sort { $a <=> $b } keys %oidcounts)
{
next unless $oidcounts{$oid} > 1;
$found = 1;
print "$oid\n";
}
exit $found;