Re: Is there a better way to do this? - Mailing list pgsql-general

From Tom Lane
Subject Re: Is there a better way to do this?
Date
Msg-id 16118.1188347420@sss.pgh.pa.us
Whole thread Raw
In response to Re: Is there a better way to do this?  (Michael Glaesemann <grzm@seespotcode.net>)
Responses Re: Is there a better way to do this?  (Michael Glaesemann <grzm@seespotcode.net>)
List pgsql-general
Michael Glaesemann <grzm@seespotcode.net> writes:
> Note that interval '1 day' is not equal to interval '24 hours'. '1
> day' can be 23 or 25 hours across daylight saving time boundaries.

When you are adding to timestamp without time zone, they *are*
interchangeable, since no daylight-savings arithmetic is involved.
Michael's right for the case of adding to timestamp with time zone,
though.

> Do you *really* want timestamp without time zone?

I agree with that comment --- you should at least think hard
about what you are trying to represent.  The "date" type is also
worth considering if time-of-day isn't so important to you.

            regards, tom lane

pgsql-general by date:

Previous
From: "D. Dante Lorenso"
Date:
Subject: Re: Is there a better way to do this?
Next
From: Alvaro Herrera
Date:
Subject: Re: Out of Memory - 8.2.4