Skip to content

Commit e557db1

Browse files
committed
Fix prologue of get_partition_ancestors()
The callers of this function assume that the first Oid in the list returned by this function corresponds to the immediate parent and the last on corresponds to the topmost parent. Make that explicit in the function prologue. Author: Ashutosh Bapat <ashutosh.bapat.oss@gmail.com> Discussion: https://www.postgresql.org/message-id/CAExHW5vCbATEmht861=G-BFPHNwLUqyeGa_=8-xibJ6Q1UxAeA@mail.gmail.com
1 parent 9ca6e7b commit e557db1

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/backend/catalog/partition.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,9 @@ get_partition_parent_worker(Relation inhRel, Oid relid, bool *detach_pending)
123123
* get_partition_ancestors
124124
* Obtain ancestors of given relation
125125
*
126-
* Returns a list of ancestors of the given relation.
126+
* Returns a list of ancestors of the given relation. The list is ordered:
127+
* The first element is the immediate parent and the last one is the topmost
128+
* parent in the partition hierarchy.
127129
*
128130
* Note: Because this function assumes that the relation whose OID is passed
129131
* as an argument and each ancestor will have precisely one parent, it should

0 commit comments

Comments
 (0)