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

Difference in DATEs

From: "Dean Gibson (DB Administrator)" <postgresql3(at)ultimeth(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Difference in DATEs
Date: 2004-09-21 07:38:59
Message-ID: 5.1.0.14.2.20040921003212.00a958d8@postgresql3.ultimeth.com (view raw or flat)
Thread:
Lists: pgsql-sql
Assume that x and y are of type DATE:

1. AGE( x, y ) < INTERVAL '...' works.

2. x < y + INTERVAL '...' works.

3. x - y < INTERVAL '...' doesn't work (but then, the minus operator is not 
defined in the manual for two DATE values).

Question:  Is the meaning of x - y well-defined?  That is, is there a 
definition that I can count on?

Not an important question, but I'm curious, since I like to write date 
differences in a style that makes readability/maintenance easy.

-- Dean


Responses

pgsql-sql by date

Next:From: Nagaraj GSDate: 2004-09-21 07:46:17
Subject: postgres rpm
Previous:From: Dean Gibson (DB Administrator)Date: 2004-09-21 06:24:39
Subject: Re: JOIN performance

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