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

Browse pgsql-bugs by date

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

Browse pgsql-hackers by date

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