Re: Patch for SQL-standard negative valued year-month literals - Mailing list pgsql-hackers

From Stephen R. van den Berg
Subject Re: Patch for SQL-standard negative valued year-month literals
Date
Msg-id 20080917122911.GA14080@cuci.nl
Whole thread Raw
In response to Re: Patch for SQL-standard negative valued year-month literals  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: Patch for SQL-standard negative valued year-month literals  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Tom Lane wrote:
>Ron Mayer <rm_pg@cheapcomplexdevices.com> writes:
>> Tom Lane wrote:
>> If I read SQL 200N's spec correctly

>>   select interval '-1 1:00:00';

>> should mean        "-1 days -1 hours",
>> yet 8.3 sees it as "-1 days +1 hours".

>I think we are kind of stuck on this one.  If we change it, then how
>would one represent -1 days +1 hours?  The spec's format is only sane
>if you assume all the fields must have the same sign, which is not
>the case for PG.

-1 days +1 hours = interval '-0 23:00:00'

Intervals are a scalar, not an addition of assorted values, alternating signs
between fields would be wrong.
-- 
Sincerely,          Stephen R. van den Berg.

He did a quarter of the work in *half* the time!


pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: Common Table Expressions (WITH RECURSIVE) patch
Next
From: Tom Lane
Date:
Subject: Re: Patch for SQL-standard negative valued year-month literals