On Thu, Mar 20, 2025 at 2:56 PM Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
"David G. Johnston" <david.g.johnston@xxxxxxxxx> writes:
> On Thu, Mar 20, 2025 at 11:54 AM Tom Lane <tgl@xxxxxxxxxxxxx> wrote:
>> I think it's a mistake to suppose that pg_type_d.h is the only
>> place where there's a risk of confusion. We should be thinking
>> about this more generally: genbki.pl is taking zero thought to
>> make what it emits readable. I think it would help to
>> label the sections it emits, perhaps along the lines of
>> /* Auto-generated OID macros */
> I'd consider this enough for the moment, so long as we explicitly address
> the cross-version constancy of the OID values associated with each type.
That's documented elsewhere, I believe. For the foo_d.h files,
I think it'd be sufficient to do something like 0001 attached.
WFM. Thanks.
Also, while checking out the results, I noticed that pg_class.h
has an "extern" in the wrong place: it's exposed to client code
which can have no use for it. That extern doesn't mention any
backend-only typedefs, so it's fairly harmless, but it's still
a clear example of somebody not reading the memo. Hence 0002.
Maybe tack this onto genbki.h?
diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h
index 26e205529d..4a1567a46b 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -146,4 +146,6 @@
*/
#undef EXPOSE_TO_CLIENT_CODE
+/* Additional backend-only code is placed after the client-code section. */
+
#endif /* GENBKI_H */
index 26e205529d..4a1567a46b 100644
--- a/src/include/catalog/genbki.h
+++ b/src/include/catalog/genbki.h
@@ -146,4 +146,6 @@
*/
#undef EXPOSE_TO_CLIENT_CODE
+/* Additional backend-only code is placed after the client-code section. */
+
#endif /* GENBKI_H */
David J.