Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitfc92450

Browse files
committed
Add an errdetail explaining why we reject infinite dates and timestamps
while converting to XML. Bernd Helmle
1 parent25bf7f8 commitfc92450

File tree

1 file changed

+7
-4
lines changed
  • src/backend/utils/adt

1 file changed

+7
-4
lines changed

‎src/backend/utils/adt/xml.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.84 2009/03/23 21:00:39 adunstan Exp $
10+
* $PostgreSQL: pgsql/src/backend/utils/adt/xml.c,v 1.85 2009/03/27 18:56:57 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1627,7 +1627,8 @@ map_sql_value_to_xml_value(Datum value, Oid type)
16271627
if (DATE_NOT_FINITE(date))
16281628
ereport(ERROR,
16291629
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
1630-
errmsg("date out of range")));
1630+
errmsg("date out of range"),
1631+
errdetail("XML does not support infinite date values.")));
16311632
j2date(date+POSTGRES_EPOCH_JDATE,
16321633
&(tm.tm_year),&(tm.tm_mon),&(tm.tm_mday));
16331634
EncodeDateOnly(&tm,USE_XSD_DATES,buf);
@@ -1649,7 +1650,8 @@ map_sql_value_to_xml_value(Datum value, Oid type)
16491650
if (TIMESTAMP_NOT_FINITE(timestamp))
16501651
ereport(ERROR,
16511652
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
1652-
errmsg("timestamp out of range")));
1653+
errmsg("timestamp out of range"),
1654+
errdetail("XML does not support infinite timestamp values.")));
16531655
elseif (timestamp2tm(timestamp,NULL,&tm,&fsec,NULL,NULL)==0)
16541656
EncodeDateTime(&tm,fsec,NULL,&tzn,USE_XSD_DATES,buf);
16551657
else
@@ -1675,7 +1677,8 @@ map_sql_value_to_xml_value(Datum value, Oid type)
16751677
if (TIMESTAMP_NOT_FINITE(timestamp))
16761678
ereport(ERROR,
16771679
(errcode(ERRCODE_DATETIME_VALUE_OUT_OF_RANGE),
1678-
errmsg("timestamp out of range")));
1680+
errmsg("timestamp out of range"),
1681+
errdetail("XML does not support infinite timestamp values.")));
16791682
elseif (timestamp2tm(timestamp,&tz,&tm,&fsec,&tzn,NULL)==0)
16801683
EncodeDateTime(&tm,fsec,&tz,&tzn,USE_XSD_DATES,buf);
16811684
else

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp