dbTalk Databases Forums  

Re: Setting date and time

comp.databases.postgresql.novice comp.databases.postgresql.novice


Discuss Re: Setting date and time in the comp.databases.postgresql.novice forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Manuel Sugawara
 
Posts: n/a

Default Re: Setting date and time - 01-28-2004 , 10:50 PM






George Weaver <gweaver (AT) shaw (DOT) ca> writes:

Quote:
Hi Everyone,

Is it possible to reset the data and time in*postmaster without
restarting it?
PostgreSQL uses the OS clock for date/time issues. If you can change
the date on your system, PostgreSQL won't complain, AFAIK.

Regards,
Manuel.

---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?

http://archives.postgresql.org



Reply With Quote
  #2  
Old   
George Weaver
 
Posts: n/a

Default Re: Setting date and time - 01-29-2004 , 07:28 AM






Hi Manuel,

Thanks for the response.

From what I can determine, postmaster gets the OS date and time when its
starts up, but then seems to maintain the data and time independently. If
you change the OS date or time after postmaster is running, the two systems
will be out of synch. I'm hoping to determine if there is a way to "reset"
the postmaster date and time to match that of the OS if they are out of
synch, without restarting postmaster.

Regards,
George


----- Original Message -----
From: "Manuel Sugawara" <masm (AT) fciencias (DOT) unam.mx>
To: "George Weaver" <gweaver (AT) shaw (DOT) ca>
Cc: <pgsql-novice (AT) postgresql (DOT) org>
Sent: Wednesday, January 28, 2004 10:50 PM
Subject: Re: [NOVICE] Setting date and time


George Weaver <gweaver (AT) shaw (DOT) ca> writes:

Quote:
Hi Everyone,

Is it possible to reset the data and time in postmaster without
restarting it?
PostgreSQL uses the OS clock for date/time issues. If you can change
the date on your system, PostgreSQL won't complain, AFAIK.

Regards,
Manuel.


---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
  #3  
Old   
Manuel Sugawara
 
Posts: n/a

Default Re: Setting date and time - 01-29-2004 , 10:31 AM



George Weaver <gweaver (AT) shaw (DOT) ca> writes:

Quote:
Hi Manuel,

Thanks for the response.

From what I can determine, postmaster gets the OS date and time when
its starts up, but then seems to maintain the data and time
independently.
Uh, I don't think so.

Quote:
If you change the OS date or time after postmaster is running, the
two systems will be out of synch.
Have you actually tried?. A little experimentation in my machine shows
that this assertion is indeed false. Try it your self.

Regards,
Manuel.

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



Reply With Quote
  #4  
Old   
Tom Lane
 
Posts: n/a

Default Re: Setting date and time - 01-29-2004 , 10:46 AM



George Weaver <gweaver (AT) shaw (DOT) ca> writes:
Quote:
From what I can determine, postmaster gets the OS date and time when its
starts up, but then seems to maintain the data and time independently.
This is certainly not so. Perhaps you should tell us exactly what you
are doing to draw that conclusion ...

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
  #5  
Old   
George Weaver
 
Posts: n/a

Default Re: Setting date and time - 01-29-2004 , 11:28 AM



I am running version 7.3.2 on Windows XP.

If I change the system date to a different date on the PC, and query the
database (Select current_date), the result I get is the date on the system
relative to when postmaster started as a service, not the new date on the
PC. Am I missing something really obvious?? : (

test=# select now();
now
----------------------------
2004-01-29 11:25:06.553-06
(1 row)

test=# \!
$ date
Thu Jan 29 11:25:09 CST 2004
$ date 01\25\2004
Sun Jan 25 20:04:00 CST 2004
$ date
Sun Jan 25 20:04:01 CST 2004
$ exit

test=# select now();
now
----------------------------
2004-01-29 11:25:34.032-06
(1 row)

----- Original Message -----
From: "Tom Lane" <tgl (AT) sss (DOT) pgh.pa.us>
To: "George Weaver" <gweaver (AT) shaw (DOT) ca>
Cc: "Manuel Sugawara" <masm (AT) fciencias (DOT) unam.mx>;
<pgsql-novice (AT) postgresql (DOT) org>
Sent: Thursday, January 29, 2004 10:46 AM
Subject: Re: [NOVICE] Setting date and time


Quote:
George Weaver <gweaver (AT) shaw (DOT) ca> writes:
From what I can determine, postmaster gets the OS date and time when its
starts up, but then seems to maintain the data and time independently.

This is certainly not so. Perhaps you should tell us exactly what you
are doing to draw that conclusion ...

regards, tom lane


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



Reply With Quote
  #6  
Old   
Tom Lane
 
Posts: n/a

Default Re: Setting date and time - 01-29-2004 , 12:00 PM



George Weaver <gweaver (AT) shaw (DOT) ca> writes:
Quote:
I am running version 7.3.2 on Windows XP.
If I change the system date to a different date on the PC, and query the
database (Select current_date), the result I get is the date on the system
relative to when postmaster started as a service, not the new date on the
PC. Am I missing something really obvious?? : (
Hm, you're running PG under Cygwin then? This must be a Cygwin issue.
Postgres itself gets the time from the operating system at the start of
each transaction, and it's going to believe whatever the Cygwin
implementation of gettimeofday() tells it.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.