Re: Patch for SQL-standard negative valued year-month literals

From: "Stephen R(dot) van den Berg" <srb(at)cuci(dot)nl>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Patch for SQL-standard negative valued year-month literals
Date: 2008-09-17 12:29:11
Message-ID: 20080917122911.GA14080@cuci.nl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Tom Lane wrote:
>Ron Mayer <rm_pg(at)cheapcomplexdevices(dot)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!

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2008-09-17 12:38:49 Re: Patch for SQL-standard negative valued year-month literals
Previous Message Tom Lane 2008-09-17 12:25:44 Re: Common Table Expressions (WITH RECURSIVE) patch