Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 0234ed8

Browse files
author
Amit Kapila
committed
Move related functions next to each other in pg_publication.c.
This also improves comments atop is_publishable_class(). Author: Peter Smith Reviewed-by: Amit Kapila, Hou Zhijie Discussion: https://postgr.es/m/CAHut+PupQ5UW9A9ut0Yjt21J9tHhx958z5L0k8-9hTYf_NYqxA@mail.gmail.com
1 parent bbe08b8 commit 0234ed8

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

src/backend/catalog/pg_publication.c

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -115,8 +115,8 @@ check_publication_add_schema(Oid schemaid)
115115
* Returns if relation represented by oid and Form_pg_class entry
116116
* is publishable.
117117
*
118-
* Does same checks as the above, but does not need relation to be opened
119-
* and also does not throw errors.
118+
* Does same checks as check_publication_add_relation() above, but does not
119+
* need relation to be opened and also does not throw errors.
120120
*
121121
* XXX This also excludes all tables with relid < FirstNormalObjectId,
122122
* ie all tables created during initdb. This mainly affects the preinstalled
@@ -140,6 +140,15 @@ is_publishable_class(Oid relid, Form_pg_class reltuple)
140140
relid >= FirstNormalObjectId;
141141
}
142142

143+
/*
144+
* Another variant of is_publishable_class(), taking a Relation.
145+
*/
146+
bool
147+
is_publishable_relation(Relation rel)
148+
{
149+
return is_publishable_class(RelationGetRelid(rel), rel->rd_rel);
150+
}
151+
143152
/*
144153
* Filter out the partitions whose parent tables were also specified in
145154
* the publication.
@@ -179,15 +188,6 @@ filter_partitions(List *relids)
179188
return result;
180189
}
181190

182-
/*
183-
* Another variant of this, taking a Relation.
184-
*/
185-
bool
186-
is_publishable_relation(Relation rel)
187-
{
188-
return is_publishable_class(RelationGetRelid(rel), rel->rd_rel);
189-
}
190-
191191
/*
192192
* Returns true if any schema is associated with the publication, false if no
193193
* schema is associated with the publication.

0 commit comments

Comments
 (0)