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

From Tom Lane
Subject Re: Is this a bug? : select '26/10/2003'::date + interval '1 day';
Date
Msg-id 19453.1053618245@sss.pgh.pa.us
Whole thread Raw
In response to Is this a bug? : select '26/10/2003'::date + interval '1 day';  (Conxita Marín <comarin@telefonica.net>)
List pgsql-general
=?iso-8859-1?Q?Conxita_Mar=EDn?= <comarin@telefonica.net> writes:
> Is this a bug?

Not if Oct 26 is a daylight savings transition day where you live.

There's been discussion of whether type interval should represent
'1 day' differently from '24 hours'.  The current behavior is surely
correct for an interval of '24 hours', but arguably it's not what you
want if you say '1 day'.  No one's got round to making it happen though.

In the meantime, I suspect what you are really looking for is the
date-plus-integer operation, not the date-plus-interval operation.
The latter promotes the date to a timestamp, which doesn't seem to
be what you would like.

            regards, tom lane

pgsql-general by date:

Previous
From: Erik Price
Date:
Subject: Re: PRIMARY KEYS
Next
From: Bruno Wolff III
Date:
Subject: Re: SELECT DISTINCT ON bug?