From cd72c1b76e36525fb6b23418d232df661634afd5 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Fri, 21 Mar 2025 15:09:46 -0400 Subject: [PATCH] Label the contents of pg_*_d.h files a little better. Make genbki.pl emit some boilerplate comments identifying the sections of the pg_*_d.h files that it generates. This is in hopes of making them slightly more readable, in case people look at those files and not the pg_*.h/pg_*.dat originals. Discussion: https://postgr.es/m/1134562.1742507765@sss.pgh.pa.us --- src/backend/catalog/genbki.pl | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index 2501307c92e..df3231fcd41 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -480,6 +480,8 @@ foreach my $catname (@catnames) EOM + printf $def "/* Macros related to the structure of $catname */\n\n"; + # Emit OID macros for catalog's OID and rowtype OID, if wanted printf $def "#define %s %s\n", $catalog->{relation_oid_macro}, $catalog->{relation_oid} @@ -561,6 +563,7 @@ EOM print $def "\n#define Natts_$catname $attnum\n\n"; # Emit client code copied from source header + printf $def "/* Definitions copied from ${catname}.h */\n\n"; foreach my $line (@{ $catalog->{client_code} }) { print $def $line; @@ -573,6 +576,9 @@ EOM print $bki "open $catname\n"; } + printf $def + "\n/* OID symbols for objects defined in ${catname}.dat */\n\n"; + # For pg_attribute.h, we generate data entries ourselves. if ($catname eq 'pg_attribute') {