@@ -67,7 +67,8 @@ static Oid get_parent_of_partition_internal(Oid partition,
67
67
const PartRelationInfo *
68
68
refresh_pathman_relation_info (Oid relid ,
69
69
PartType partitioning_type ,
70
- const char * part_column_name )
70
+ const char * part_column_name ,
71
+ bool allow_incomplete )
71
72
{
72
73
const LOCKMODE lockmode = AccessShareLock ;
73
74
const TypeCacheEntry * typcache ;
@@ -103,14 +104,14 @@ refresh_pathman_relation_info(Oid relid,
103
104
}
104
105
105
106
/* First we assume that this entry is invalid */
106
- prel -> valid = false;
107
+ prel -> valid = false;
107
108
108
109
/* Make both arrays point to NULL */
109
- prel -> children = NULL ;
110
- prel -> ranges = NULL ;
110
+ prel -> children = NULL ;
111
+ prel -> ranges = NULL ;
111
112
112
113
/* Set partitioning type */
113
- prel -> parttype = partitioning_type ;
114
+ prel -> parttype = partitioning_type ;
114
115
115
116
/* Initialize PartRelationInfo using syscache & typcache */
116
117
prel -> attnum = get_attnum (relid , part_column_name );
@@ -245,9 +246,8 @@ get_pathman_relation_info(Oid relid)
245
246
246
247
/* Refresh partitioned table cache entry (might turn NULL) */
247
248
/* TODO: possible refactoring, pass found 'prel' instead of searching */
248
- prel = refresh_pathman_relation_info (relid ,
249
- part_type ,
250
- attname );
249
+ prel = refresh_pathman_relation_info (relid , part_type ,
250
+ attname , false);
251
251
}
252
252
/* Else clear remaining cache entry */
253
253
else remove_pathman_relation_info (relid );
@@ -611,10 +611,10 @@ try_perform_parent_refresh(Oid parent)
611
611
parttype = DatumGetPartType (values [Anum_pathman_config_parttype - 1 ]);
612
612
attname = DatumGetTextP (values [Anum_pathman_config_attname - 1 ]);
613
613
614
- /* If anything went wrong, return false (actually, it might throw ERROR) */
615
- if (! PrelIsValid ( refresh_pathman_relation_info (parent , parttype ,
616
- text_to_cstring (attname ))))
617
- return false;
614
+ /* If anything went wrong, return false (actually, it might emit ERROR) */
615
+ refresh_pathman_relation_info (parent , parttype ,
616
+ text_to_cstring (attname ),
617
+ true); /* allow lazy */
618
618
}
619
619
/* Not a partitioned relation */
620
620
else return false;
0 commit comments