Re: Bug #733: Date Arithmetics within plsql

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: joerg(dot)wedeck(at)datacare(dot)de, pgsql-bugs(at)postgresql(dot)org
Subject: Re: Bug #733: Date Arithmetics within plsql
Date: 2002-08-08 02:06:57
Message-ID: 28467.1028772417@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

pgsql-bugs(at)postgresql(dot)org writes:
> jw=# select inc_date (date '2002-10-25', interval '1 day');
> inc_date
> ------------
> 2002-10-26 -> ok
> (1 row)

What you probably want here is the date plus integer operator.

There is no date plus interval operator --- what you are actually
getting is implicit promotion of date to timestamp, then timestamp
plus interval, then coercion back to date. Unfortunately that's
going to create roundoff problems when you cross daylight-savings
boundaries.

regards, tom lane

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2002-08-08 02:09:09 Re: followup question Bug #476: pg_dump error: dtoi4: integer out of range
Previous Message Jean-Luc Lachance 2002-08-07 17:09:04 Re: Bug #733: Date Arithmetics within plsql