*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.206 2009/06/01 16:55:11 tgl Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/adt/datetime.c,v 1.207 2009/06/10 05:05:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
break;
case INTERVAL_MASK(HOUR):
case INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR):
- case INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE):
- case INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND):
type = DTK_HOUR;
break;
case INTERVAL_MASK(MINUTE):
case INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE):
+ case INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE):
type = DTK_MINUTE;
break;
case INTERVAL_MASK(SECOND):
- case INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND):
case INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND):
+ case INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND):
+ case INTERVAL_MASK(DAY) | INTERVAL_MASK(HOUR) | INTERVAL_MASK(MINUTE) | INTERVAL_MASK(SECOND):
type = DTK_SECOND;
break;
default:
(1 row)
SELECT interval '1 2' day to minute;
- interval
-----------------
- 1 day 02:00:00
-(1 row)
-
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to minute;
+ ^
SELECT interval '1 2:03' day to minute;
interval
----------------
(1 row)
SELECT interval '1 2' day to second;
- interval
-----------------
- 1 day 02:00:00
-(1 row)
-
+ERROR: invalid input syntax for type interval: "1 2"
+LINE 1: SELECT interval '1 2' day to second;
+ ^
SELECT interval '1 2:03' day to second;
interval
----------------
(1 row)
SELECT interval '1 2.345' day to second(2);
- interval
-----------------
- 1 day 02:20:42
-(1 row)
-
+ERROR: invalid input syntax for type interval: "1 2.345"
+LINE 1: SELECT interval '1 2.345' day to second(2);
+ ^
SELECT interval '1 2:03' day to second(2);
interval
----------------