Skip to content

Commit aa162a1

Browse files
committed
fixes for refresh_pathman_relation_info(), use allow_incomplete in find_inheritance_children_array() call
1 parent f775ebb commit aa162a1

File tree

1 file changed

+13
-2
lines changed

1 file changed

+13
-2
lines changed

src/relation_info.c

Lines changed: 13 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,9 +23,10 @@
2323
#include "utils/builtins.h"
2424
#include "utils/fmgroids.h"
2525
#include "utils/hsearch.h"
26-
#include "utils/lsyscache.h"
2726
#include "utils/memutils.h"
2827
#include "utils/snapmgr.h"
28+
#include "utils/syscache.h"
29+
#include "utils/lsyscache.h"
2930
#include "utils/typcache.h"
3031

3132

@@ -144,8 +145,18 @@ refresh_pathman_relation_info(Oid relid,
144145
}
145146
else LockRelationOid(relid, lockmode);
146147

148+
/* Check if parent exists */
149+
if (!SearchSysCacheExists1(RELOID, ObjectIdGetDatum(relid)))
150+
{
151+
/* Nope, it doesn't, remove this entry and exit */
152+
UnlockRelationOid(relid, lockmode);
153+
remove_pathman_relation_info(relid);
154+
return NULL; /* exit */
155+
}
156+
147157
/* Try searching for children (don't wait if we can't lock) */
148-
switch (find_inheritance_children_array(relid, lockmode, true,
158+
switch (find_inheritance_children_array(relid, lockmode,
159+
allow_incomplete,
149160
&prel_children_count,
150161
&prel_children))
151162
{

0 commit comments

Comments
 (0)