pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Forcing postgres to reload current time zone.
2+ messages / 2 participants
[nested] [flat]

* Forcing postgres to reload current time zone.
@ 2004-07-01 13:48  trena-no-spam@cotse.net
  0 siblings, 1 reply; 2+ messages in thread

From: trena-no-spam@cotse.net @ 2004-07-01 13:48 UTC (permalink / raw)
  To: pgsql-admin

Hello,

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?

I've done quite a bit of searching for this answer and I'm not coming up
with anything useful. I'm running postgres on RedHat Linux 9.

Many thanks,

trena





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

* Re: Forcing postgres to reload current time zone.
@ 2004-07-10 04:25  Tom Lane <tgl@sss.pgh.pa.us>
  parent: trena-no-spam@cotse.net
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-07-10 04:25 UTC (permalink / raw)
  To: trena-no-spam@cotse.net; +Cc: pgsql-admin

<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



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


end of thread, other threads:[~2004-07-10 04:25 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-01 13:48 Forcing postgres to reload current time zone. trena-no-spam@cotse.net
2004-07-10 04:25 ` Tom Lane <tgl@sss.pgh.pa.us>

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