t->typmods = $3;
$$ = makeStringConstCast($2, @2, t);
}
- | ConstInterval '(' Iconst ')' Sconst opt_interval
+ | ConstInterval '(' Iconst ')' Sconst
{
TypeName *t = $1;
- if ($6 != NIL)
- {
- A_Const *n = (A_Const *) linitial($6);
- if ((n->val.val.ival & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0)
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("time zone interval must be HOUR or HOUR TO MINUTE"),
- parser_errposition(@6)));
- if (list_length($6) != 1)
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("interval precision specified twice"),
- parser_errposition(@1)));
- t->typmods = lappend($6, makeIntConst($3, @3));
- }
- else
- t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
- makeIntConst($3, @3));
+ t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
+ makeIntConst($3, @3));
$$ = makeStringConstCast($5, @5, t);
}
| NumericOnly { $$ = makeAConst($1, @1); }
$$ = $1;
$$->typmods = $2;
}
- | ConstInterval '(' Iconst ')' opt_interval
+ | ConstInterval '(' Iconst ')'
{
$$ = $1;
- if ($5 != NIL)
- {
- if (list_length($5) != 1)
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("interval precision specified twice"),
- parser_errposition(@1)));
- $$->typmods = lappend($5, makeIntConst($3, @3));
- }
- else
- $$->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
- makeIntConst($3, @3));
+ $$->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
+ makeIntConst($3, @3));
}
;
t->typmods = $3;
$$ = makeStringConstCast($2, @2, t);
}
- | ConstInterval '(' Iconst ')' Sconst opt_interval
+ | ConstInterval '(' Iconst ')' Sconst
{
TypeName *t = $1;
- if ($6 != NIL)
- {
- if (list_length($6) != 1)
- ereport(ERROR,
- (errcode(ERRCODE_SYNTAX_ERROR),
- errmsg("interval precision specified twice"),
- parser_errposition(@1)));
- t->typmods = lappend($6, makeIntConst($3, @3));
- }
- else
- t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
- makeIntConst($3, @3));
+ t->typmods = list_make2(makeIntConst(INTERVAL_FULL_RANGE, -1),
+ makeIntConst($3, @3));
$$ = makeStringConstCast($5, @5, t);
}
| TRUE_P