Re: timestamp arithmetic (a possible bug?) - Mailing list pgsql-bugs

From Tom Lane
Subject Re: timestamp arithmetic (a possible bug?)
Date
Msg-id 15567.1088786090@sss.pgh.pa.us
Whole thread Raw
In response to Re: timestamp arithmetic (a possible bug?)  (Stephan Szabo <sszabo@megazone.bigpanda.com>)
List pgsql-bugs
Stephan Szabo <sszabo@megazone.bigpanda.com> writes:
>>> Should we be providing an interval + timestamp operator as well since it
>>> looks like the spec implies both orderings should work?
>>
>> If you see spec support for it, then yes ... where do you read that
>> exactly?

> SQL92 (draft) 4.5.3 Operators involving datetimes and intervals (the table
> appears to be the same in SQL99 4.7.3)

Yeah.  It looks like we have most of these, but would need to add
    interval + date
    interval + timetz
    interval + timestamp
    interval + timestamptz
and for consistency
    integer + date
Curiously, we do have interval + time without time zone ... I guess Tom
Lockhart overlooked these when he was working in the area.

I notice also that date - date yields an integer (ie, number of days)
where I think that strict spec compliance would mandate yielding an
interval instead.  I'm uneager to change this though.

            regards, tom lane

pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: Possible bug?
Next
From: Tom Lane
Date:
Subject: Re: Grant Update (Possible bug)?