Home > Archive > PostgreSQL Discussion > February 2006 > now() time off









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author now() time off
John McCawley

2006-02-25, 9:44 am

Earlier this week when I logged into my database, I just so happened to
notice that the value for now() was six hours off of the time reported
by the operating system when using the date command from the command
line. How is this possible? I rebooted the server and the problem
magically went away. I am quite certain that I didn't modify anything
in the database that should cause this problem. It turns out that that
the now() time has been off for some time, and resulted in quite a bit
of corrupted data. What exactly should I do in the future to keep this
from happening, or where should I look for clues?

John

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Scott Marlowe

2006-02-25, 9:44 am

On Wed, 2006-02-22 at 16:36, John McCawley wrote:
> Earlier this week when I logged into my database, I just so happened to
> notice that the value for now() was six hours off of the time reported
> by the operating system when using the date command from the command
> line. How is this possible? I rebooted the server and the problem
> magically went away. I am quite certain that I didn't modify anything
> in the database that should cause this problem. It turns out that that
> the now() time has been off for some time, and resulted in quite a bit
> of corrupted data. What exactly should I do in the future to keep this
> from happening, or where should I look for clues?


Sounds like a time zone issue. I'd start looking there.

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Jim C. Nasby

2006-02-25, 9:44 am

On Wed, Feb 22, 2006 at 04:46:35PM -0600, Scott Marlowe wrote:
> On Wed, 2006-02-22 at 16:36, John McCawley wrote:
>
> Sounds like a time zone issue. I'd start looking there.


I've been bitten by this before as well. I'd be in favor of adding an
option such that postmaster would refuse to start if TZ was something
other than UTC; I'd much rather that then have a bunch of data get
screwed up...
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 6: explain analyze is your friend

Martijn van Oosterhout

2006-02-25, 9:44 am

On Wed, Feb 22, 2006 at 06:35:55PM -0600, Jim C. Nasby wrote:
> On Wed, Feb 22, 2006 at 04:46:35PM -0600, Scott Marlowe wrote:
>
> I've been bitten by this before as well. I'd be in favor of adding an
> option such that postmaster would refuse to start if TZ was something
> other than UTC; I'd much rather that then have a bunch of data get
> screwed up...


Alternativly you could just set the "timezone" parameter in the
postgresql configuration...

Have a nice day,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.


Jim C. Nasby

2006-02-25, 9:44 am

On Thu, Feb 23, 2006 at 12:41:38PM +0100, Martijn van Oosterhout wrote:
> On Wed, Feb 22, 2006 at 06:35:55PM -0600, Jim C. Nasby wrote:
>
> Alternativly you could just set the "timezone" parameter in the
> postgresql configuration...


Wow, didn't know that was there... was it added fairly recently or have
I just been blind?
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Michael Fuhr

2006-02-25, 9:44 am

On Thu, Feb 23, 2006 at 04:21:19PM -0600, Jim C. Nasby wrote:
> On Thu, Feb 23, 2006 at 12:41:38PM +0100, Martijn van Oosterhout wrote:
>
> Wow, didn't know that was there... was it added fairly recently or have
> I just been blind?


http://www.postgresql.org/docs/7.3/...elease-7-3.html

"Add configuration variables datestyle and timezone (Tom)"

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 1: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo@postgresql
.org so that your
message can get through to the mailing list cleanly

Jim C. Nasby

2006-02-25, 9:44 am

On Thu, Feb 23, 2006 at 03:49:50PM -0700, Michael Fuhr wrote:
> On Thu, Feb 23, 2006 at 04:21:19PM -0600, Jim C. Nasby wrote:
>
> http://www.postgresql.org/docs/7.3/...elease-7-3.html
>
> "Add configuration variables datestyle and timezone (Tom)"


Whew. I started on 7.2, so I have a bit of an excuse. :)
--
Jim C. Nasby, Sr. Engineering Consultant jnasby@pervasive.com
Pervasive Software http://pervasive.com work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf cell: 512-569-9461

---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com