@@ -452,7 +452,7 @@ get_non_null_list_datum_count(PartitionBoundSpec **boundspecs, int nparts)
452452
453453foreach (lc ,boundspecs [i ]-> listdatums )
454454{
455- Const * val = castNode (Const ,lfirst ( lc ) );
455+ Const * val = lfirst_node (Const ,lc );
456456
457457if (!val -> constisnull )
458458count ++ ;
@@ -513,7 +513,7 @@ create_list_bounds(PartitionBoundSpec **boundspecs, int nparts,
513513
514514foreach (c ,spec -> listdatums )
515515{
516- Const * val = castNode (Const ,lfirst ( c ) );
516+ Const * val = lfirst_node (Const ,c );
517517
518518if (!val -> constisnull )
519519{
@@ -3014,7 +3014,7 @@ check_new_partition_bound(char *relname, Relation parent,
30143014
30153015foreach (cell ,spec -> listdatums )
30163016{
3017- Const * val = castNode (Const ,lfirst ( cell ) );
3017+ Const * val = lfirst_node (Const ,cell );
30183018
30193019overlap_location = val -> location ;
30203020if (!val -> constisnull )
@@ -3399,7 +3399,7 @@ make_one_partition_rbound(PartitionKey key, int index, List *datums, bool lower)
33993399i = 0 ;
34003400foreach (lc ,datums )
34013401{
3402- PartitionRangeDatum * datum = castNode (PartitionRangeDatum ,lfirst ( lc ) );
3402+ PartitionRangeDatum * datum = lfirst_node (PartitionRangeDatum ,lc );
34033403
34043404/* What's contained in this range datum? */
34053405bound -> kind [i ]= datum -> kind ;
@@ -4103,7 +4103,7 @@ get_qual_for_list(Relation parent, PartitionBoundSpec *spec)
41034103 */
41044104foreach (cell ,spec -> listdatums )
41054105{
4106- Const * val = castNode (Const ,lfirst ( cell ) );
4106+ Const * val = lfirst_node (Const ,cell );
41074107
41084108if (val -> constisnull )
41094109list_has_null = true;
@@ -4358,8 +4358,8 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
43584358Datum test_result ;
43594359bool isNull ;
43604360
4361- ldatum = castNode (PartitionRangeDatum ,lfirst ( cell1 ) );
4362- udatum = castNode (PartitionRangeDatum ,lfirst ( cell2 ) );
4361+ ldatum = lfirst_node (PartitionRangeDatum ,cell1 );
4362+ udatum = lfirst_node (PartitionRangeDatum ,cell2 );
43634363
43644364/*
43654365 * Since get_range_key_properties() modifies partexprs_item, and we
@@ -4440,11 +4440,11 @@ get_qual_for_range(Relation parent, PartitionBoundSpec *spec,
44404440PartitionRangeDatum * ldatum_next = NULL ,
44414441* udatum_next = NULL ;
44424442
4443- ldatum = castNode (PartitionRangeDatum ,lfirst ( cell1 ) );
4443+ ldatum = lfirst_node (PartitionRangeDatum ,cell1 );
44444444if (lnext (spec -> lowerdatums ,cell1 ))
44454445ldatum_next = castNode (PartitionRangeDatum ,
44464446lfirst (lnext (spec -> lowerdatums ,cell1 )));
4447- udatum = castNode (PartitionRangeDatum ,lfirst ( cell2 ) );
4447+ udatum = lfirst_node (PartitionRangeDatum ,cell2 );
44484448if (lnext (spec -> upperdatums ,cell2 ))
44494449udatum_next = castNode (PartitionRangeDatum ,
44504450lfirst (lnext (spec -> upperdatums ,cell2 )));