Re: What's wrong with my date/interval arithmetic?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Wojtek <wojtg(at)polbox(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: What's wrong with my date/interval arithmetic?
Date: 2004-03-02 06:25:21
Message-ID: 23923.1078208721@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Wojtek <wojtg(at)polbox(dot)com> writes:
> Why is the "result" incorrect (off by one day)?
> When I do the exactly same arithmetic using timestamps created
> with to_timestamp, everything is OK ("expected_result").

It is not "exactly the same arithmetic", because to_timestamp
delivers a result of type timestamp-with-time-zone, whereas your
other values are evidently timestamp without time zone. You did
not say what timezone setting you are using, but I think the
discrepancy is probably explained by that.

regards, tom lane

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Wojtek 2004-03-02 07:00:46 Re: What's wrong with my date/interval arithmetic?
Previous Message Wojtek 2004-03-02 06:01:33 What's wrong with my date/interval arithmetic?