Skip to content

Commit 89dcaef

Browse files
committed
use find_inheritance_children_array() in add_to_pathman_config()
1 parent 5d43c57 commit 89dcaef

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

src/init.c

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -418,8 +418,6 @@ find_inheritance_children_array(Oid parentrelId,
418418

419419
uint32 i;
420420

421-
Assert(lockmode != NoLock);
422-
423421
/* Init safe return values */
424422
*children_size = 0;
425423
*children = NULL;

src/pl_funcs.c

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -708,6 +708,9 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
708708
char *expression;
709709
PartType parttype;
710710

711+
Oid *children;
712+
uint32 children_count;
713+
711714
Relation pathman_config;
712715
Datum values[Natts_pathman_config];
713716
bool isnull[Natts_pathman_config];
@@ -823,8 +826,12 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
823826
heap_close(pathman_config, RowExclusiveLock);
824827

825828
/* Update caches only if this relation has children */
826-
if (has_subclass(relid))
829+
if (FCS_FOUND == find_inheritance_children_array(relid, NoLock, true,
830+
&children_count,
831+
&children))
827832
{
833+
pfree(children);
834+
828835
/* Now try to create a PartRelationInfo */
829836
PG_TRY();
830837
{

0 commit comments

Comments
 (0)