Re: bug?

From: Laurette Cisneros <laurette(at)nextbus(dot)com>
To: Oskar Berggren <beo(at)sgs(dot)o(dot)se>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug?
Date: 2002-12-07 01:12:47
Message-ID: Pine.LNX.4.44.0212061712340.9186-100000@visor.corp.nextbus.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Doh! Duh!

Thanks!
On Sat, 7 Dec 2002, Oskar Berggren wrote:

> Laurette Cisneros wrote:
> > What is the difference between these two queries? Is this a bug?
> >
>
> > select case when current_timestamp < '2002-12-06'::date + 1
>
> > select case when current_timestamp < '2002-12-06'::date + 1::interval
>
> Yes there is a difference:
>
> select '2002-12-06'::date + 1;
> ?column?
> ------------
> 2002-12-07
> (1 row)
>
>
> select '2002-12-06'::date + 1::interval;
> ?column?
> ------------------------
> 2002-12-06 00:00:01+01
> (1 row)
>
>
> As you can see, 1::interval means one second, not one day.
>
> /Oskar
>

--
Laurette Cisneros
The Database Group
(510) 420-3137
NextBus Information Systems, Inc.
www.nextbus.com
----------------------------------
There's more to life than just SQL.

In response to

  • Re: bug? at 2002-12-07 00:45:10 from Oskar Berggren

Browse pgsql-general by date

  From Date Subject
Next Message Thomas O'Connell 2002-12-07 01:14:12 Re: [GENERAL] PostgreSQL Global Development Group Announces
Previous Message Oskar Berggren 2002-12-07 00:45:10 Re: bug?