Error message and infinite date and timestamp conversion in XML

Started by Bernd Helmleabout 17 years ago4 messageshackers
Jump to latest
#1Bernd Helmle
mailings@oopsware.de

map_sql_value_to_xml_value() currently errors out with a more or less vague
error message, when a date or timestamp datatype with an infinite value is
converted to XML. This is likely to create some confusion, especially when
you have to debug some complex procedures and involved XML conversions. I
propose to add the attached DETAIL to this error message, so people will
get an idea what's currently going wrong.

--
Thanks

Bernd

Attachments:

errdetail_xml_date_values.patchtext/x-diff; charset=us-ascii; name=errdetail_xml_date_values.patchDownload+3-0
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bernd Helmle (#1)
Re: Error message and infinite date and timestamp conversion in XML

Bernd Helmle <mailings@oopsware.de> writes:

map_sql_value_to_xml_value() currently errors out with a more or less vague
error message, when a date or timestamp datatype with an infinite value is
converted to XML. This is likely to create some confusion, especially when
you have to debug some complex procedures and involved XML conversions. I
propose to add the attached DETAIL to this error message, so people will
get an idea what's currently going wrong.

Done, but I noticed while testing that it's not real consistent:

regression=# select xmlelement(name foo, 'infinity'::timestamp);
ERROR: timestamp out of range
DETAIL: XML does not support infinite timestamp values.
regression=# select xmlelement(name foo, xmlattributes('infinity'::timestamp as bar));
xmlelement
-----------------------
<foo bar="infinity"/>
(1 row)

Should we consider doing something about that, or is it okay as-is?

regards, tom lane

#3Bernd Helmle
mailings@oopsware.de
In reply to: Tom Lane (#2)
Re: Error message and infinite date and timestamp conversion in XML

--On Freitag, März 27, 2009 14:59:23 -0400 Tom Lane <tgl@sss.pgh.pa.us>
wrote:

Should we consider doing something about that, or is it okay as-is?

I'd say yes, but i don't understand why xmlelement() doesn't call
map_sql_value_to_xml_value() already instead of calling the output function
directly?

--
Thanks

Bernd

#4Peter Eisentraut
peter_e@gmx.net
In reply to: Tom Lane (#2)
Re: Error message and infinite date and timestamp conversion in XML

On Friday 27 March 2009 20:59:23 Tom Lane wrote:

Done, but I noticed while testing that it's not real consistent:

regression=# select xmlelement(name foo, 'infinity'::timestamp);
ERROR: timestamp out of range
DETAIL: XML does not support infinite timestamp values.
regression=# select xmlelement(name foo,
xmlattributes('infinity'::timestamp as bar)); xmlelement
-----------------------
<foo bar="infinity"/>
(1 row)

Should we consider doing something about that, or is it okay as-is?

Fixed. It was a bug.