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

Re: Time intervals in select statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Luke McFarlane <luke(at)fisheye(dot)com(dot)au>
Cc: pgsql-bugs <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: Time intervals in select statement
Date: 2004-10-19 13:56:08
Message-ID: 15348.1098194168@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
Luke McFarlane <luke(at)fisheye(dot)com(dot)au> writes:
> It's interesting why addition assumes one operand is interval while 
> subtraction assumes it is timestamp? It should at least be consistent, IMHO.

There is no timestamp + timestamp operator, for reasons that should be
fairly apparent.  There are both timestamp - timestamp (yielding interval)
and timestamp - interval (yielding timestamp), and in case of ambiguity
the preferred interpretation is the one with the same datatype on both
sides.  See
http://www.postgresql.org/docs/7.4/static/typeconv-oper.html

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Jaime CasanovaDate: 2004-10-19 17:38:10
Subject: a bug in pg_dump?
Previous:From: Gottlieb HerbertDate: 2004-10-19 12:04:28
Subject: ODBC 7.05. from PostgreSQL 8.0 Beta 3

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