From 40038f21d863f1e206819284a264ce55773a3236 Mon Sep 17 00:00:00 2001
From: John Naylor <jcnaylor@gmail.com>
Date: Thu, 14 Dec 2017 11:52:37 +0700
Subject: [PATCH 01/10] Fix typos and oversights in catalog headers

---
 src/backend/catalog/Catalog.pm             |  3 ++-
 src/backend/catalog/Makefile               |  2 +-
 src/backend/utils/Gen_fmgrtab.pl           |  3 ++-
 src/include/catalog/pg_partitioned_table.h |  2 +-
 src/include/catalog/pg_sequence.h          | 10 ++++++++++
 src/include/catalog/pg_subscription_rel.h  |  5 +----
 6 files changed, 17 insertions(+), 8 deletions(-)

diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm
index 54f8353..0b260ec 100644
--- a/src/backend/catalog/Catalog.pm
+++ b/src/backend/catalog/Catalog.pm
@@ -36,7 +36,8 @@ sub Catalogs
 		'int64'         => 'int8',
 		'Oid'           => 'oid',
 		'NameData'      => 'name',
-		'TransactionId' => 'xid');
+		'TransactionId' => 'xid',
+		'XLogRecPtr'    => 'pg_lsn');
 
 	foreach my $input_file (@_)
 	{
diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile
index fd33426..30ca509 100644
--- a/src/backend/catalog/Makefile
+++ b/src/backend/catalog/Makefile
@@ -45,7 +45,7 @@ POSTGRES_BKI_SRCS = $(addprefix $(top_srcdir)/src/include/catalog/,\
 	pg_default_acl.h pg_init_privs.h pg_seclabel.h pg_shseclabel.h \
 	pg_collation.h pg_partitioned_table.h pg_range.h pg_transform.h \
 	pg_sequence.h pg_publication.h pg_publication_rel.h pg_subscription.h \
-	pg_subscription_rel.h toasting.h indexing.h \
+	pg_subscription_rel.h \
 	toasting.h indexing.h \
     )
 
diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl
index ee89d50..c0efc07 100644
--- a/src/backend/utils/Gen_fmgrtab.pl
+++ b/src/backend/utils/Gen_fmgrtab.pl
@@ -2,7 +2,8 @@
 #-------------------------------------------------------------------------
 #
 # Gen_fmgrtab.pl
-#    Perl script that generates fmgroids.h and fmgrtab.c from pg_proc.h
+#    Perl script that generates fmgroids.h, fmgrprotos.h, and fmgrtab.c
+#    from pg_proc.h
 #
 # Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
 # Portions Copyright (c) 1994, Regents of the University of California
diff --git a/src/include/catalog/pg_partitioned_table.h b/src/include/catalog/pg_partitioned_table.h
index 525e541..731147e 100644
--- a/src/include/catalog/pg_partitioned_table.h
+++ b/src/include/catalog/pg_partitioned_table.h
@@ -10,7 +10,7 @@
  * src/include/catalog/pg_partitioned_table.h
  *
  * NOTES
- *	  the genbki.sh script reads this file and generates .bki
+ *	  the genbki.pl script reads this file and generates .bki
  *	  information from the DATA() statements.
  *
  *-------------------------------------------------------------------------
diff --git a/src/include/catalog/pg_sequence.h b/src/include/catalog/pg_sequence.h
index 8ae6b71..6de54bb 100644
--- a/src/include/catalog/pg_sequence.h
+++ b/src/include/catalog/pg_sequence.h
@@ -1,3 +1,13 @@
+/* -------------------------------------------------------------------------
+ *
+ * pg_sequence.h
+ *	  definition of the system "sequence" relation (pg_sequence)
+ *
+ * Portions Copyright (c) 1996-2017, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * -------------------------------------------------------------------------
+ */
 #ifndef PG_SEQUENCE_H
 #define PG_SEQUENCE_H
 
diff --git a/src/include/catalog/pg_subscription_rel.h b/src/include/catalog/pg_subscription_rel.h
index 991ca9d..5748297 100644
--- a/src/include/catalog/pg_subscription_rel.h
+++ b/src/include/catalog/pg_subscription_rel.h
@@ -23,15 +23,12 @@
  */
 #define SubscriptionRelRelationId			6102
 
-/* Workaround for genbki not knowing about XLogRecPtr */
-#define pg_lsn XLogRecPtr
-
 CATALOG(pg_subscription_rel,6102) BKI_WITHOUT_OIDS
 {
 	Oid			srsubid;		/* Oid of subscription */
 	Oid			srrelid;		/* Oid of relation */
 	char		srsubstate;		/* state of the relation in subscription */
-	pg_lsn		srsublsn;		/* remote lsn of the state change used for
+	XLogRecPtr	srsublsn;		/* remote lsn of the state change used for
 								 * synchronization coordination */
 } FormData_pg_subscription_rel;
 
-- 
2.7.4

