From: Kevin Grittner <Kevin.Grittner@wicourts.gov>
To: fw@deneb.enyo.de
Cc: dcrooke@gmail.com
Cc: pgsql-performance@postgresql.org
Subject: Re: Picking out the most recent row using a time stamp column
Date: Sat, 26 Feb 2011 15:52:44 -0600
Message-ID: <4D6921CC020000250003B083@gw.wicourts.gov> (raw)
Florian Weimer wrote:
> Kevin Grittner:
>> Well, unless you use timestamp WITH time zone, you might not be
>> able to do that at all. There are very few places where timestamp
>> WITHOUT time zone actually makes sense.
>
> I don't think PostgreSQL keeps track of actual time zone values,
True -- TIMESTAMP WITH TIME ZONE is always stored in UTC, which makes
it part of a consistent time stream. If you use TIMESTAMP WITHOUT
TIME ZONE, then unless you go to a lot of trouble you have a gap in
your time line in the spring and an overlap in autumn. With enough
work you can dance around that, but it's a heck of lot easier when
you can count on the UTC storage.
It sounds like you've successfully managed to find a way to dance
around it, so it might not be worth trying to refactor now; but I'd
bet your code would be simpler and more robust if you worked with the
data type intended to represent a moment in the stream of time
instead of constantly trying to pin the WITHOUT TIME ZONE to a time
zone (UTC) explicitly.
-Kevin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-performance@postgresql.org
Cc: Kevin.Grittner@wicourts.gov, fw@deneb.enyo.de, dcrooke@gmail.com
Subject: Re: Picking out the most recent row using a time stamp column
In-Reply-To: <4D6921CC020000250003B083@gw.wicourts.gov>
References: <4D6921CC020000250003B083@gw.wicourts.gov>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox