File tree Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Expand file tree Collapse file tree 2 files changed +8
-3
lines changed Original file line number Diff line number Diff line change 1
1
<!--
2
- $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.164 2005/12/22 21:45:19 momjian Exp $
2
+ $PostgreSQL: pgsql/doc/src/sgml/datatype.sgml,v 1.165 2006/02/09 03:39:16 tgl Exp $
3
3
-->
4
4
5
5
<chapter id="datatype">
@@ -1360,7 +1360,7 @@ SELECT b, char_length(b) FROM test2;
1360
1360
<entry>4 bytes</entry>
1361
1361
<entry>dates only</entry>
1362
1362
<entry>4713 BC</entry>
1363
- <entry>32767 AD</entry>
1363
+ <entry>5874897 AD</entry>
1364
1364
<entry>1 day</entry>
1365
1365
</row>
1366
1366
<row>
Original file line number Diff line number Diff line change 8
8
*
9
9
*
10
10
* IDENTIFICATION
11
- * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.122 2005/10/15 02:49:28 momjian Exp $
11
+ * $PostgreSQL: pgsql/src/backend/utils/adt/date.c,v 1.123 2006/02/09 03:39:17 tgl Exp $
12
12
*
13
13
*-------------------------------------------------------------------------
14
14
*/
@@ -97,6 +97,11 @@ date_in(PG_FUNCTION_ARGS)
97
97
break ;
98
98
}
99
99
100
+ if (!IS_VALID_JULIAN (tm -> tm_year , tm -> tm_mon , tm -> tm_mday ))
101
+ ereport (ERROR ,
102
+ (errcode (ERRCODE_DATETIME_VALUE_OUT_OF_RANGE ),
103
+ errmsg ("date out of range: \"%s\"" , str )));
104
+
100
105
date = date2j (tm -> tm_year , tm -> tm_mon , tm -> tm_mday ) - POSTGRES_EPOCH_JDATE ;
101
106
102
107
PG_RETURN_DATEADT (date );
You can’t perform that action at this time.
0 commit comments