Skip site navigation (1) Skip section navigation (2)

Re: timestamp arithmetic (a possible bug?)

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>
Cc: Ilir Gashi <I(dot)Gashi(at)city(dot)ac(dot)uk>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: timestamp arithmetic (a possible bug?)
Date: 2004-07-02 16:34:50
Message-ID: 15567.1088786090@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)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

In response to

pgsql-bugs by date

Next:From: Tom LaneDate: 2004-07-02 16:52:42
Subject: Re: Grant Update (Possible bug)?
Previous:From: Tom LaneDate: 2004-07-02 16:05:47
Subject: Re: Possible bug?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group