@@ -363,43 +363,27 @@ create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type)
363363RangeEntry * ranges = PrelGetRangesArray (prel );
364364Datum bound_min ,/* absolute MIN */
365365bound_max ;/* absolute MAX */
366- // Infinitablebound_min,/* lower bound of all partitions */
367- // bound_max;/* upper bound of all partitions */
368- // Infinitablestart,
369- // end;
370366
371367Oid interval_type = InvalidOid ;
372368Datum interval_binary ,/* assigned 'width' of one partition */
373369interval_text ;
374370
375- // bound_min = ranges[0].min;
376- // bound_max = ranges[PrelLastChild(prel)].max;
377-
378- // start.value = !IsInfinite(&bound_min) ?
379- // datumCopy(InfinitableGetValue(&bound_min),
380- // prel->attbyval,
381- // prel->attlen) :
382- // (Datum) 0;
383- // start.is_infinite = IsInfinite(&bound_min);
384-
385- // end.value = !IsInfinite(&bound_max) ?
386- // datumCopy(InfinitableGetValue(&bound_max),
387- // prel->attbyval,
388- // prel->attlen) :
389- // (Datum) 0;
390- // end.is_infinite = IsInfinite(&bound_max);
391-
392371/* Read max & min range values from PartRelationInfo */
393- /* TODO */
394- // bound_min = PrelGetRangesArray(prel)[0].min;
395- // bound_max = PrelGetRangesArray(prel)[PrelLastChild(prel)].max;
396372bound_min = BoundGetValue (& ranges [0 ].min );
397373bound_max = BoundGetValue (& ranges [PrelLastChild (prel )].max );
398374
399375/* Copy datums on order to protect them from cache invalidation */
400376bound_min = datumCopy (bound_min ,prel -> attbyval ,prel -> attlen );
401377bound_max = datumCopy (bound_max ,prel -> attbyval ,prel -> attlen );
402378
379+ /* Check if interval is set */
380+ if (isnull [Anum_pathman_config_range_interval - 1 ])
381+ {
382+ elog (ERROR ,
383+ "Could not find appropriate partition for key '%s'" ,
384+ datum_to_cstring (value ,value_type ));
385+ }
386+
403387/* Retrieve interval as TEXT from tuple */
404388interval_text = values [Anum_pathman_config_range_interval - 1 ];
405389