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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-bugs by date

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