Commit ec9d01e8 authored by Bruce Momjian's avatar Bruce Momjian

Done:

     o -Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO
        SECOND
parent 5bbea03f
...@@ -225,7 +225,6 @@ Data Types ...@@ -225,7 +225,6 @@ Data Types
computations should adjust based on the time zone rules. computations should adjust based on the time zone rules.
o Fix SELECT '0.01 years'::interval, '0.01 months'::interval o Fix SELECT '0.01 years'::interval, '0.01 months'::interval
o Fix SELECT INTERVAL '1' MONTH
o Add a GUC variable to allow output of interval values in ISO8601 o Add a GUC variable to allow output of interval values in ISO8601
format format
o Improve timestamptz subtraction to be DST-aware o Improve timestamptz subtraction to be DST-aware
...@@ -240,8 +239,9 @@ Data Types ...@@ -240,8 +239,9 @@ Data Types
o Fix interval display to support values exceeding 2^31 hours o Fix interval display to support values exceeding 2^31 hours
o Add overflow checking to timestamp and interval arithmetic o Add overflow checking to timestamp and interval arithmetic
o Add ISO INTERVAL handling o Add ISO INTERVAL handling
o Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO o -Add support for day-time syntax, INTERVAL '1 2:03:04' DAY TO
SECOND SECOND
o Fix SELECT INTERVAL '1' MONTH
o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH o Add support for year-month syntax, INTERVAL '50-6' YEAR TO MONTH
o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or o For syntax that isn't uniquely ISO or PG syntax, like '1:30' or
'1', treat as ISO if there is a range specification clause, '1', treat as ISO if there is a range specification clause,
......
...@@ -11,7 +11,7 @@ ...@@ -11,7 +11,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.538 2006/04/15 17:45:34 tgl Exp $ * $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.539 2006/04/24 22:56:11 momjian Exp $
* *
* HISTORY * HISTORY
* AUTHOR DATE MAJOR EVENT * AUTHOR DATE MAJOR EVENT
...@@ -1152,6 +1152,7 @@ zone_value: ...@@ -1152,6 +1152,7 @@ zone_value:
A_Const *n = (A_Const *) makeStringConst($2, $1); A_Const *n = (A_Const *) makeStringConst($2, $1);
if ($3 != INTERVAL_FULL_RANGE) if ($3 != INTERVAL_FULL_RANGE)
{ {
ereport(LOG, (errmsg("1.0")));
if (($3 & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0) if (($3 & ~(INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE))) != 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR), (errcode(ERRCODE_SYNTAX_ERROR),
...@@ -1163,6 +1164,7 @@ zone_value: ...@@ -1163,6 +1164,7 @@ zone_value:
| ConstInterval '(' Iconst ')' Sconst opt_interval | ConstInterval '(' Iconst ')' Sconst opt_interval
{ {
A_Const *n = (A_Const *) makeStringConst($5, $1); A_Const *n = (A_Const *) makeStringConst($5, $1);
ereport(LOG, (errmsg("2.0")));
if ($3 < 0) if ($3 < 0)
ereport(ERROR, ereport(ERROR,
(errcode(ERRCODE_INVALID_PARAMETER_VALUE), (errcode(ERRCODE_INVALID_PARAMETER_VALUE),
...@@ -6078,12 +6080,14 @@ SimpleTypename: ...@@ -6078,12 +6080,14 @@ SimpleTypename:
| ConstDatetime { $$ = $1; } | ConstDatetime { $$ = $1; }
| ConstInterval opt_interval | ConstInterval opt_interval
{ {
ereport(LOG, (errmsg("3.0")));
$$ = $1; $$ = $1;
if ($2 != INTERVAL_FULL_RANGE) if ($2 != INTERVAL_FULL_RANGE)
$$->typmod = INTERVAL_TYPMOD(INTERVAL_FULL_PRECISION, $2); $$->typmod = INTERVAL_TYPMOD(INTERVAL_FULL_PRECISION, $2);
} }
| ConstInterval '(' Iconst ')' opt_interval | ConstInterval '(' Iconst ')' opt_interval
{ {
ereport(LOG, (errmsg("4.0")));
$$ = $1; $$ = $1;
if ($3 < 0) if ($3 < 0)
ereport(ERROR, ereport(ERROR,
...@@ -6102,6 +6106,7 @@ SimpleTypename: ...@@ -6102,6 +6106,7 @@ SimpleTypename:
} }
| type_name attrs | type_name attrs
{ {
ereport(LOG, (errmsg("5.0")));
$$ = makeNode(TypeName); $$ = makeNode(TypeName);
$$->names = lcons(makeString($1), $2); $$->names = lcons(makeString($1), $2);
$$->typmod = -1; $$->typmod = -1;
...@@ -8179,6 +8184,7 @@ AexprConst: Iconst ...@@ -8179,6 +8184,7 @@ AexprConst: Iconst
| ConstInterval Sconst opt_interval | ConstInterval Sconst opt_interval
{ {
A_Const *n = makeNode(A_Const); A_Const *n = makeNode(A_Const);
ereport(LOG, (errmsg("6.0")));
n->typename = $1; n->typename = $1;
n->val.type = T_String; n->val.type = T_String;
n->val.val.str = $2; n->val.val.str = $2;
...@@ -8190,6 +8196,7 @@ AexprConst: Iconst ...@@ -8190,6 +8196,7 @@ AexprConst: Iconst
| ConstInterval '(' Iconst ')' Sconst opt_interval | ConstInterval '(' Iconst ')' Sconst opt_interval
{ {
A_Const *n = makeNode(A_Const); A_Const *n = makeNode(A_Const);
ereport(LOG, (errmsg("7.0")));
n->typename = $1; n->typename = $1;
n->val.type = T_String; n->val.type = T_String;
n->val.val.str = $5; n->val.val.str = $5;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment