Re: What's wrong with my date/interval arithmetic? - Mailing list pgsql-sql

From Tom Lane
Subject Re: What's wrong with my date/interval arithmetic?
Date
Msg-id 23923.1078208721@sss.pgh.pa.us
Whole thread Raw
In response to What's wrong with my date/interval arithmetic?  (Wojtek <wojtg@polbox.com>)
Responses Re: What's wrong with my date/interval arithmetic?
Strings in UDFs
List pgsql-sql
Wojtek <wojtg@polbox.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


pgsql-sql by date:

Previous
From: Wojtek
Date:
Subject: What's wrong with my date/interval arithmetic?
Next
From: Wojtek
Date:
Subject: Re: What's wrong with my date/interval arithmetic?