From 2813ed2fd74ad283206b861794b41d558f6eca54 Mon Sep 17 00:00:00 2001
From: Peter Smith <peter.b.smith@fujitsu.com>
Date: Fri, 29 Jul 2022 14:31:39 +1000
Subject: [PATCH v2] Functions 'is_publishable_class' and
 'is_publishable_relation' should be together.

---
 src/backend/catalog/pg_publication.c | 22 +++++++++++-----------
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/src/backend/catalog/pg_publication.c b/src/backend/catalog/pg_publication.c
index ade3bf3..e294bea 100644
--- a/src/backend/catalog/pg_publication.c
+++ b/src/backend/catalog/pg_publication.c
@@ -115,8 +115,8 @@ check_publication_add_schema(Oid schemaid)
  * Returns if relation represented by oid and Form_pg_class entry
  * is publishable.
  *
- * Does same checks as the above, but does not need relation to be opened
- * and also does not throw errors.
+ * Does same checks as check_publication_add_relation() above, but does not
+ * need relation to be opened and also does not throw errors.
  *
  * XXX  This also excludes all tables with relid < FirstNormalObjectId,
  * ie all tables created during initdb.  This mainly affects the preinstalled
@@ -141,6 +141,15 @@ is_publishable_class(Oid relid, Form_pg_class reltuple)
 }
 
 /*
+ * Another variant of is_publishable_class(), taking a Relation.
+ */
+bool
+is_publishable_relation(Relation rel)
+{
+	return is_publishable_class(RelationGetRelid(rel), rel->rd_rel);
+}
+
+/*
  * Filter out the partitions whose parent tables were also specified in
  * the publication.
  */
@@ -180,15 +189,6 @@ filter_partitions(List *relids)
 }
 
 /*
- * Another variant of this, taking a Relation.
- */
-bool
-is_publishable_relation(Relation rel)
-{
-	return is_publishable_class(RelationGetRelid(rel), rel->rd_rel);
-}
-
-/*
  * Returns true if any schema is associated with the publication, false if no
  * schema is associated with the publication.
  */
-- 
1.8.3.1

