@@ -363,43 +363,27 @@ create_partitions_for_value_internal(Oid relid, Datum value, Oid value_type)
363
363
RangeEntry * ranges = PrelGetRangesArray (prel );
364
364
Datum bound_min , /* absolute MIN */
365
365
bound_max ; /* absolute MAX */
366
- // Infinitable bound_min, /* lower bound of all partitions */
367
- // bound_max; /* upper bound of all partitions */
368
- // Infinitable start,
369
- // end;
370
366
371
367
Oid interval_type = InvalidOid ;
372
368
Datum interval_binary , /* assigned 'width' of one partition */
373
369
interval_text ;
374
370
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
-
392
371
/* Read max & min range values from PartRelationInfo */
393
- /* TODO */
394
- // bound_min = PrelGetRangesArray(prel)[0].min;
395
- // bound_max = PrelGetRangesArray(prel)[PrelLastChild(prel)].max;
396
372
bound_min = BoundGetValue (& ranges [0 ].min );
397
373
bound_max = BoundGetValue (& ranges [PrelLastChild (prel )].max );
398
374
399
375
/* Copy datums on order to protect them from cache invalidation */
400
376
bound_min = datumCopy (bound_min , prel -> attbyval , prel -> attlen );
401
377
bound_max = datumCopy (bound_max , prel -> attbyval , prel -> attlen );
402
378
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
+
403
387
/* Retrieve interval as TEXT from tuple */
404
388
interval_text = values [Anum_pathman_config_range_interval - 1 ];
405
389
0 commit comments