From: Jonathan Brinkman <JB@BlackSkyTech.com>
To: 'Kevin Grittner' <Kevin.Grittner@wicourts.gov>
To: pgsql-bugs@postgresql.org
To: 'Tom Lane' <tgl@sss.pgh.pa.us>
Subject: Re: LOCALTIMESTAMP has wrong time zone
Date: Fri, 25 Feb 2011 11:44:34 -0500
Message-ID: <003001cbd50b$48f9ad30$daed0790$@com> (raw)
In-Reply-To: <4D67812A020000250003B02D@gw.wicourts.gov>
References: <000001cbd468$124cc720$36e65560$@com>
<4D6681F1020000250003AFED@gw.wicourts.gov>
<000a01cbd473$9f317fe0$dd947fa0$@com>
<4D668E47020000250003AFF2@gw.wicourts.gov>
<002801cbd4f7$a62bcc90$f28365b0$@com>
<4D67812A020000250003B02D@gw.wicourts.gov>
Solved.
Changing the field datatype from TIMESTAMP to TIMESTAMPTZ fixed it. Now I
can use now() as the default value.
Strange that it just cropped up recently, but you're right we should be
including time zone with that timestamp anyways.
My deep gratitude for your time and help!
JB
-----Original Message-----
From: Kevin Grittner [mailto:Kevin.Grittner@wicourts.gov]
Sent: Friday, February 25, 2011 11:15 AM
To: JB@BlackSkyTech.com; pgsql-bugs@postgresql.org; 'Tom Lane'
Subject: RE: [BUGS] LOCALTIMESTAMP has wrong time zone
"Jonathan Brinkman" <JB@BlackSkyTech.com> wrote:
> ## I COULDN'T MAKE IT BREAK USING PSQL.
That's pretty solid evidence that the problem isn't in the
PostgreSQL server.
> This didn't always happen, it just started happening on various of
> my tables a maybe couple weeks or so ago. I think it is related to
> an update, either to Ubuntu 10.04 or Postgresql 8.4. I usually
> apt-get update/upgrade whenever I see that updates are available.
I would look at /var/log/dpkg.log to see what you installed at the
point when things broke.
> Also, this only occurs on my production server (Rackspace cloud).
> My dev postgres server doesn't do this timestamp time-zone problem
> at all.
I would be taking a close look at what the differences are.
Anything that is the same on both servers can't be the problem,
right?
I'm going to harp on one other point -- you will almost certainly be
better off if you make these columns TIMESTAMP WITH TIME ZONE. This
is the type which is meant to represent moments in the stream of
time. It will behave as you probably expect in many more
circumstances, especially when recording when events occurred.
WITHOUT TIME ZONE is mostly useful for scheduling future events
which you want to happen at different points in time in different
time zones, or for scheduling things which should occur in whatever
time is in effect locally when the related date arrives.
-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-bugs@postgresql.org
Cc: JB@BlackSkyTech.com, Kevin.Grittner@wicourts.gov, tgl@sss.pgh.pa.us
Subject: Re: LOCALTIMESTAMP has wrong time zone
In-Reply-To: <003001cbd50b$48f9ad30$daed0790$@com>
References: <000001cbd468$124cc720$36e65560$@com> <4D6681F1020000250003AFED@gw.wicourts.gov> <000a01cbd473$9f317fe0$dd947fa0$@com> <4D668E47020000250003AFF2@gw.wicourts.gov> <002801cbd4f7$a62bcc90$f28365b0$@com> <4D67812A020000250003B02D@gw.wicourts.gov> <003001cbd50b$48f9ad30$daed0790$@com>
* 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