File tree Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Expand file tree Collapse file tree 1 file changed +13
-2
lines changed Original file line number Diff line number Diff line change 23
23
#include "utils/builtins.h"
24
24
#include "utils/fmgroids.h"
25
25
#include "utils/hsearch.h"
26
- #include "utils/lsyscache.h"
27
26
#include "utils/memutils.h"
28
27
#include "utils/snapmgr.h"
28
+ #include "utils/syscache.h"
29
+ #include "utils/lsyscache.h"
29
30
#include "utils/typcache.h"
30
31
31
32
@@ -144,8 +145,18 @@ refresh_pathman_relation_info(Oid relid,
144
145
}
145
146
else LockRelationOid (relid , lockmode );
146
147
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
+
147
157
/* 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 ,
149
160
& prel_children_count ,
150
161
& prel_children ))
151
162
{
You can’t perform that action at this time.
0 commit comments