Re: Is this a bug? : select '26/10/2003'::date + interval - Mailing list pgsql-general

From Conxita Marín
Subject Re: Is this a bug? : select '26/10/2003'::date + interval
Date
Msg-id 003801c320fd$cc7c0380$0cd8a8c0@dims
Whole thread Raw
In response to Re: Is this a bug? : select '26/10/2003'::date + interval  (Stephan Szabo <sszabo@megazone23.bigpanda.com>)
List pgsql-general
Thanks all for your responses.

That is, Oct 26 is a daylight savings transition day im my area. Postgres
interpret interval '1 day' equal to 24 hours and Oct 26 day has 25 hours, so
the day doesn't change.

To add exactly 1 day to any date I do this, such as Tom Lane suggests:

s001=> select '26/10/2003'::date + 1;
  ?column?
------------
 27/10/2003
(1 row)

Regards,

Conxita

-----Original Message-----
From: pgsql-general-owner@postgresql.org
[mailto:pgsql-general-owner@postgresql.org]On Behalf Of Stephan Szabo
Sent: jueves, 22 de mayo de 2003 18:13
To: cmarin@dims.com
Cc: Pgsql-General-post (E-mail)
Subject: Re: [GENERAL] Is this a bug? : select '26/10/2003'::date +
interval


s001=> select '26/10/2003'::date + 1;
  ?column?
------------
 27/10/2003
(1 row)

On Thu, 22 May 2003, [iso-8859-1] Conxita Marín wrote:

> Hi.
>
> Is this a bug?
>
> s001=> select '25/10/2003'::date + interval '1 day';
>          ?column?
> --------------------------
>  26/10/2003 00:00:00 CEST
> (1 row)
>
> s001=> select '26/10/2003'::date + interval '1 day';
>         ?column?
> -------------------------
>  26/10/2003 23:00:00 CET  (????)
> (1 row)

Is that your daylight savings time changeover point (appears to be from
the output, but it's worth checking).  IIRC '1 day' is taken as equivalent
to 24 hours which because of the time zone switch causes the above (it'd
presumably be 27/10/2003 00:00:00 CEST but that's not your timezone
anymore).


---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
    (send "unregister YourEmailAddressHere" to majordomo@postgresql.org)


pgsql-general by date:

Previous
From: Stephan Szabo
Date:
Subject: Re: deadlocks problem
Next
From: Richard Huxton
Date:
Subject: Re: Tool for BackUp