pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: trena-no-spam@cotse.net
Cc: pgsql-admin@postgresql.org
Subject: Re: Forcing postgres to reload current time zone.
Date: Sat, 10 Jul 2004 00:25:01 -0400
Message-ID: <2719.1089433501@sss.pgh.pa.us> (raw)
In-Reply-To: <dHJlbmE=.a1f5c74717693b1d1ebc35f898424005@1088689713.nulluser.com>
References: <dHJlbmE=.a1f5c74717693b1d1ebc35f898424005@1088689713.nulluser.com>

<trena-no-spam@cotse.net> writes:
> I'm writing an application that issues "SELECT current_timestamp" from
> postgres on a regular basis to get the time. However, the user may
> change the system's time zone and postgres does not seem to reflect this
> change  unless I restart the database daemon. I cannot have all of my
> program threads issue a SET TIME ZONE query, and was hoping there is a
> query I could issue that would globally update the time zone for all
> currently running postgres sessions, or a more gentle way to force
> postgres to reload its time zone information without completely
> restarting the daemon. Any advice?

Readjust your objectives?  AFAIK every other daemon in your system will
behave the same way.

You could force Postgres into a new timezone by adjusting the timezone
setting in postgresql.conf and SIGHUP'ing the postmaster.  But it hardly
seems reasonable to build a mechanism to make that happen whenever the
user hacks on the system-wide timezone setting (especially considering
what a wide variety of means there are in different Unixen for defining
what the "system-wide timezone" is).

Note also that the timezone is hardly the only setting which your user
will have trouble changing on-the-fly --- locale and IP address come to
mind, and I'm sure there are others.  Again, Postgres is not the only
daemon that is not designed to recognize such changes instantly.

			regards, tom lane



view thread (2+ messages)

Message-ID: <2719.1089433501@sss.pgh.pa.us>
Permalink:  ../2719.1089433501@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/2719.1089433501@sss.pgh.pa.us

 · 

reply

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-admin@postgresql.org
  Cc: tgl@sss.pgh.pa.us, trena-no-spam@cotse.net
  Subject: Re: Forcing postgres to reload current time zone.
  In-Reply-To: <2719.1089433501@sss.pgh.pa.us>
  References: <dHJlbmE=.a1f5c74717693b1d1ebc35f898424005@1088689713.nulluser.com> <2719.1089433501@sss.pgh.pa.us>

* 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