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

Re: BUG #1993: Adding/subtracting negative time intervals

From: Klint Gore <kg(at)kgb(dot)une(dot)edu(dot)au>
To: Russell Smith <mr-russ(at)pws(dot)com(dot)au>
Cc: pgsql-bugs(at)postgresql(dot)org, Nicholas <hb(at)x256(dot)com>
Subject: Re: BUG #1993: Adding/subtracting negative time intervals
Date: 2005-10-25 02:48:10
Message-ID: 435D9CEA291.BE6BKG@129.180.47.120 (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-hackers
On Tue, 25 Oct 2005 08:51:59 +1000, Russell Smith <mr-russ(at)pws(dot)com(dot)au> wrote:
> Nicholas wrote:
> > postgres=# SELECT NOW()-interval '1 week';
> >            ?column?
> > -------------------------------
> >  2005-10-17 08:52:37.355219+10
> > (1 row)
> > 
> > postgres=# SELECT NOW()-interval '-1 week';
> >            ?column?
> > -------------------------------
> >  2005-10-31 08:52:39.021583+11
> 
> Looks to mee like Daylight Savings has conveniently started.

But the elapsed time for those results is only 6 days, 23 hours.

That's changed since v7.4.7

template1=# select now();
              now
-------------------------------
 2005-10-25 12:40:22.699545+10
(1 row)

template1=# select now() + '1 week'::interval;
           ?column?
------------------------------
 2005-11-01 13:40:33.85492+11
(1 row)

template1=# select now() - '-1 week'::interval;
           ?column?
-------------------------------
 2005-11-01 13:40:46.707656+11
(1 row)

template1=# select version();
                                                 version

--------------------------------------------------------------------------------
-------------------------
 PostgreSQL 7.4.7 on i686-pc-linux-gnu, compiled by GCC gcc (GCC) 3.2.2 20030222
 (Red Hat Linux 3.2.2-5)
(1 row)


+---------------------------------------+-----------------+
: Klint Gore                            : "Non rhyming    :
: EMail   : kg(at)kgb(dot)une(dot)edu(dot)au           :  slang - the    :
: Snail   : A.B.R.I.                    :  possibilities  :
: Mail      University of New England   :  are useless"   :
:           Armidale NSW 2351 Australia :     L.J.J.      :
: Fax     : +61 2 6772 5376             :                 :
+---------------------------------------+-----------------+

In response to

Responses

pgsql-hackers by date

Next:From: Christopher Kings-LynneDate: 2005-10-25 03:08:56
Subject: Re: PostgreSQL 8.1 Beta 4
Previous:From: Bruce MomjianDate: 2005-10-25 02:43:16
Subject: Re: [GENERAL] 'a' == 'a '

pgsql-bugs by date

Next:From: Tom LaneDate: 2005-10-25 03:21:52
Subject: Re: BUG #1993: Adding/subtracting negative time intervals
Previous:From: Tom LaneDate: 2005-10-25 02:33:38
Subject: Re: BUG #1996: DISTINCT fails with national character varying

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