Add data for WAL in pg_stat_io and backend statistics
[pgsql.git] / src / include / catalog / duplicate_oids
blobb8ab4ed80bf2911ad7bdf0272e47c9ed13f950d6
1 #!/usr/bin/perl
2 #----------------------------------------------------------------------
4 # duplicate_oids
5 # Identifies any manually-assigned OIDs that are used multiple times
6 # in the Postgres catalog data.
8 # While duplicate OIDs would only cause a failure if they appear in
9 # the same catalog, our project policy is that manually assigned OIDs
10 # should be globally unique, to avoid confusion.
12 # Portions Copyright (c) 1996-2025, PostgreSQL Global Development Group
13 # Portions Copyright (c) 1994, Regents of the University of California
15 # src/include/catalog/duplicate_oids
17 #----------------------------------------------------------------------
19 use strict;
20 use warnings FATAL => 'all';
22 # Must run in src/include/catalog
23 use FindBin;
24 chdir $FindBin::RealBin or die "could not cd to $FindBin::RealBin: $!\n";
26 use lib "$FindBin::RealBin/../../backend/catalog/";
27 use Catalog;
29 my @input_files = glob("pg_*.h");
31 my $oids = Catalog::FindAllOidsFromHeaders(@input_files);
33 my %oidcounts;
35 foreach my $oid (@{$oids})
37 $oidcounts{$oid}++;
40 my $found = 0;
42 foreach my $oid (sort { $a <=> $b } keys %oidcounts)
44 next unless $oidcounts{$oid} > 1;
45 $found = 1;
46 print "$oid\n";
49 exit $found;