X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 44FC5D1B1DC for ; Sat, 10 Jul 2004 01:25:04 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 49964-10 for ; Sat, 10 Jul 2004 04:25:09 +0000 (GMT) Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by svr1.postgresql.org (Postfix) with ESMTP id EBE44D1B1A5 for ; Sat, 10 Jul 2004 01:25:02 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.11/8.12.11) with ESMTP id i6A4P1jD002720; Sat, 10 Jul 2004 00:25:03 -0400 (EDT) To: trena-no-spam@cotse.net Cc: pgsql-admin@postgresql.org Subject: Re: Forcing postgres to reload current time zone. In-reply-to: References: Comments: In-reply-to message dated "Thu, 01 Jul 2004 09:48:33 -0400" Date: Sat, 10 Jul 2004 00:25:01 -0400 Message-ID: <2719.1089433501@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.0 tagged_above=0.0 required=5.0 tests= X-Spam-Level: X-Archive-Number: 200407/127 X-Sequence-Number: 14195 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