Re: setting local time without restarting server

From: Bruno Wolff III <bruno(at)wolff(dot)to>
To: Anony Mous <A(dot)Mous(at)shaw(dot)ca>, pgsql-general(at)postgresql(dot)org
Subject: Re: setting local time without restarting server
Date: 2004-05-13 20:31:10
Message-ID: 20040513203110.GA24414@wolff.to
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, May 13, 2004 at 15:07:13 -0500,
Bruno Wolff III <bruno(at)wolff(dot)to> wrote:
> On Thu, May 13, 2004 at 12:56:48 -0600,
> Anony Mous <A(dot)Mous(at)shaw(dot)ca> wrote:
> > Hi,
> >
> > Is there a function that would allow me to set the local time while the
> > server is running? I can't seem to find anything on this...
>
> You probably want to set the timezone, not the local time.
> You can do that with something like:
> SET TIMEZONE='EST5EDT';

Thinking about this some more; this only changes it for the session not
the default for new sessions.

Reading the documentation suggests that you can set the timezone in the
config file and sighup the postmaster to get it to reread the config file.
It might also be possible to change the underlying system's timezone
and do a sighup to have it pick up the correct timezone.

If the underlying system has the correct timezone, but for some reason has
the wrong time, you should be able to change its time. How you do that
varies a bit from system to system. Under *nix systems you usually use
the 'date' command (if you aren't using ntp). Under Linux, at least,
you also want to run setclock to set the hardware clock to the right
time so the time is still correct after the next reboot.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mike G 2004-05-13 20:44:15 CAST truncates without warning
Previous Message Gregory Wood 2004-05-13 20:10:34 Re: dbmirror