Re: Is this a bug? : select '26/10/2003'::date + interval '1 day';

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: cmarin(at)dims(dot)com
Cc: "Pgsql-General-post (E-mail)" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is this a bug? : select '26/10/2003'::date + interval '1 day';
Date: 2003-05-22 15:44:05
Message-ID: 19453.1053618245@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

=?iso-8859-1?Q?Conxita_Mar=EDn?= <comarin(at)telefonica(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2003-05-22 15:49:57 Re: SELECT DISTINCT ON bug?
Previous Message wsheldah 2003-05-22 15:43:50 Re: PRIMARY KEYS