Re: xmlelement AND timestamps.

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
Cc: Lynn Dobbs <lynn(dot)dobbs(at)creditlink(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: xmlelement AND timestamps.
Date: 2017-02-14 02:10:40
Message-ID: CAKFQuwYay7PytFm+7SEvw0hByRNjeqog_c+V52PSFGNf5_rrbg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, Feb 13, 2017 at 6:36 PM, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
wrote:

> On 02/13/2017 02:56 PM, Lynn Dobbs wrote:
>
>> I just migrated from 9.2.4 to 9.6.1 and had several user created
>> functions fail.
>>
>> Recreating the failure with "SELECT xmlelement(name foo,
>> 'infinity'::timestamp)
>> ERROR: timestamp out of range
>> DETAIL: XML does not support infinite timestamp values.
>>
>> I don't find anything in the documentation that explains this. I
>> consider this a regression.
>>
>
> All I could find was this thread from 2009:
>
> https://www.postgresql.org/message-id/41F26B729B014C3E8F20F5B7%40teje
>
> which indicated it was fixed at that time.

​Actually, the cause of said commit (circa 2009) is that xmlelements were
failing but xmlattributes were not​...which makes me wonder how a 9.2 era
release (circa 2012) supposedly worked with the submitted expression.

The basic answer is that the XML data type is defined by standard and we
attempt to conform to the standard. In order to do so we must disallow
infinite timestamps even though we accept them in SQL.

I just tested the OP query on 9.0.x and 9.4.x and get the same error on
both.

There'd be a bit more sympathy if the OP were complaining about a patch
release changing behavior - bug fix or not - but since the complaint
involves going from 9.2 to 9.6 on its face this is an allowed behavior
change regardless of the history.

However, feel free to make a straight argument for accepting infinite
timestamps and thus go above-and-beyond the relevant standards. Personally
this seems like a not-so-useful restriction on our implementation. Let the
user decide whether they want to deviate from the standard and risk
cross-system incompatibilities. XML itself is textual and we don't have
any internal support for DTD or Schema as it is so I'm not sure what
material benefit we gain by restraining ourselves here.

David J.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Michael Paquier 2017-02-14 02:26:31 Re: Causeless CPU load waves in backend, on windows, 9.5.5 (EDB binary).
Previous Message Adrian Klaver 2017-02-14 01:36:04 Re: xmlelement AND timestamps.