pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Time slowly goes out of sync Cygwin+windows+psotgres
3+ messages / 3 participants
[nested] [flat]

* Time slowly goes out of sync Cygwin+windows+psotgres
@ 2002-08-23 00:52  Aaron <aarmel@netagi.com>
  0 siblings, 2 replies; 3+ messages in thread

From: Aaron @ 2002-08-23 00:52 UTC (permalink / raw)
  To: pgsql-admin

Running postgres on cygwin and windows.

Cygwin has the correct time.
Windows has the same time as cygwin.

Postgres slowly goes out of sync.  Over a month it ends up 10 minutes out.

using e.g. "SELECT NOW()";

restart the machine and posgres is only 30 seconds out.

Is postgres calculateing the time itself or reading of the machines clock?

Is there a setting to make it go off the operating system clock?




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Time slowly goes out of sync Cygwin+windows+psotgres
@ 2002-08-29 14:14  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Aaron <aarmel@netagi.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Tom Lane @ 2002-08-29 14:14 UTC (permalink / raw)
  To: Aaron <aarmel@netagi.com>; +Cc: pgsql-admin

Aaron <aarmel@netagi.com> writes:
> Is postgres calculateing the time itself or reading of the machines clock?

Postgres just asks the OS what time it is.  I think you have an
off-speed system clock crystal (lots of PC-grade hardware will
gain or lose 10 minutes/month :-().

I don't know what test you are using to convince yourself that the OS
time is correct when Postgres' time is different --- but I'll bet lunch
you made a mistake.

One other thing to watch for is that "SELECT now()" returns the time as
of the start of the current transaction.  If you said "begin" and then
waited ten minutes you could get a 10-minute discrepancy.  I doubt you
did that, but it's something to be aware of.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Time slowly goes out of sync Cygwin+windows+psotgres
@ 2002-08-29 14:22  Stephan Szabo <sszabo@megazone23.bigpanda.com>
  parent: Aaron <aarmel@netagi.com>
  1 sibling, 0 replies; 3+ messages in thread

From: Stephan Szabo @ 2002-08-29 14:22 UTC (permalink / raw)
  To: Aaron <aarmel@netagi.com>; +Cc: pgsql-admin

On Fri, 23 Aug 2002, Aaron wrote:

> Running postgres on cygwin and windows.
>
> Cygwin has the correct time.
> Windows has the same time as cygwin.
>
> Postgres slowly goes out of sync.  Over a month it ends up 10 minutes out.
>
> using e.g. "SELECT NOW()";

It might be possible that time() and gettimeofday() are returning
different times, we use the latter, I'd guess that what you're using
to get the date may use the former if it only gives integral seconds.





^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2002-08-29 14:22 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-08-23 00:52 Time slowly goes out of sync Cygwin+windows+psotgres Aaron <aarmel@netagi.com>
2002-08-29 14:14 ` Tom Lane <tgl@sss.pgh.pa.us>
2002-08-29 14:22 ` Stephan Szabo <sszabo@megazone23.bigpanda.com>

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