@@ -1552,27 +1552,11 @@ zone_value:
1552
1552
t->typmods = $3 ;
1553
1553
$$ = makeStringConstCast($2 , @2 , t);
1554
1554
}
1555
- | ConstInterval ' (' Iconst ' )' Sconst opt_interval
1555
+ | ConstInterval ' (' Iconst ' )' Sconst
1556
1556
{
1557
1557
TypeName *t = $1 ;
1558
- if ($6 != NIL)
1559
- {
1560
- A_Const *n = (A_Const *) linitial($6 );
1561
- if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0 )
1562
- ereport (ERROR,
1563
- (errcode(ERRCODE_SYNTAX_ERROR),
1564
- errmsg(" time zone interval must be HOUR or HOUR TO MINUTE" ),
1565
- parser_errposition(@6 )));
1566
- if (list_length($6 ) != 1 )
1567
- ereport (ERROR,
1568
- (errcode(ERRCODE_SYNTAX_ERROR),
1569
- errmsg(" interval precision specified twice" ),
1570
- parser_errposition(@1 )));
1571
- t->typmods = lappend($6 , makeIntConst($3 , @3 ));
1572
- }
1573
- else
1574
- t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1 ),
1575
- makeIntConst ($3 , @3 ));
1558
+ t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1 ),
1559
+ makeIntConst ($3 , @3 ));
1576
1560
$$ = makeStringConstCast($5 , @5 , t);
1577
1561
}
1578
1562
| NumericOnly { $$ = makeAConst($1 , @1 ); }
@@ -10582,21 +10566,11 @@ SimpleTypename:
10582
10566
$$ = $1 ;
10583
10567
$$ ->typmods = $2 ;
10584
10568
}
10585
- | ConstInterval ' (' Iconst ' )' opt_interval
10569
+ | ConstInterval ' (' Iconst ' )'
10586
10570
{
10587
10571
$$ = $1 ;
10588
- if ($5 != NIL)
10589
- {
10590
- if (list_length($5 ) != 1 )
10591
- ereport (ERROR,
10592
- (errcode(ERRCODE_SYNTAX_ERROR),
10593
- errmsg(" interval precision specified twice" ),
10594
- parser_errposition(@1 )));
10595
- $$ ->typmods = lappend($5 , makeIntConst($3 , @3 ));
10596
- }
10597
- else
10598
- $$ ->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1 ),
10599
- makeIntConst ($3 , @3 ));
10572
+ $$ ->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1 ),
10573
+ makeIntConst ($3 , @3 ));
10600
10574
}
10601
10575
;
10602
10576
@@ -12923,21 +12897,11 @@ AexprConst: Iconst
12923
12897
t->typmods = $3 ;
12924
12898
$$ = makeStringConstCast ($2 , @2 , t);
12925
12899
}
12926
- | ConstInterval ' (' Iconst ' )' Sconst opt_interval
12900
+ | ConstInterval ' (' Iconst ' )' Sconst
12927
12901
{
12928
12902
TypeName *t = $1 ;
12929
- if ($6 != NIL)
12930
- {
12931
- if (list_length ($6 ) != 1 )
12932
- ereport (ERROR,
12933
- (errcode (ERRCODE_SYNTAX_ERROR),
12934
- errmsg (" interval precision specified twice" ),
12935
- parser_errposition (@1 )));
12936
- t->typmods = lappend ($6 , makeIntConst ($3 , @3 ));
12937
- }
12938
- else
12939
- t->typmods = list_make2 (makeIntConst (INTERVAL_FULL_RANGE, -1 ),
12940
- makeIntConst ($3 , @3 ));
12903
+ t->typmods = list_make2 (makeIntConst (INTERVAL_FULL_RANGE, -1 ),
12904
+ makeIntConst ($3 , @3 ));
12941
12905
$$ = makeStringConstCast ($5 , @5 , t);
12942
12906
}
12943
12907
| TRUE_P
0 commit comments