Re: bug?

From: Oskar Berggren <beo(at)sgs(dot)o(dot)se>
To: Laurette Cisneros <laurette(at)nextbus(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: bug?
Date: 2002-12-07 00:45:10
Message-ID: 3DF14496.3080609@sgs.o.se
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

In response to

  • bug? at 2002-12-07 00:32:02 from Laurette Cisneros

Responses

  • Re: bug? at 2002-12-07 01:12:47 from Laurette Cisneros

Browse pgsql-general by date

  From Date Subject
Next Message Laurette Cisneros 2002-12-07 01:12:47 Re: bug?
Previous Message Laurette Cisneros 2002-12-07 00:32:02 bug?