Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eEcMw-0006ok-JI for pgsql-general@arkaria.postgresql.org; Tue, 14 Nov 2017 14:39:18 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1eEcMw-0006rt-6n for pgsql-general@arkaria.postgresql.org; Tue, 14 Nov 2017 14:39:18 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eEcKN-00026I-Tf for pgsql-general@postgresql.org; Tue, 14 Nov 2017 14:36:40 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1eEcKK-00058x-Lq for pgsql-general@postgresql.org; Tue, 14 Nov 2017 14:36:38 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id vAEEaVxX015671; Tue, 14 Nov 2017 09:36:31 -0500 From: Tom Lane To: Thomas Kellerer cc: pgsql-general@postgresql.org Subject: Re: Retrieve the server's time zone In-reply-to: References: Comments: In-reply-to Thomas Kellerer message dated "Tue, 14 Nov 2017 10:58:23 +0100" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <15669.1510670191.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Tue, 14 Nov 2017 09:36:31 -0500 Message-ID: <15670.1510670191@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-general Precedence: bulk Sender: pgsql-general-owner@postgresql.org Thomas Kellerer writes: > is there any way (short of writing a function in an untrusted PL) to dete= rmine the actual time zone (or time) of the server OS?=20 The default value of the timezone parameter is as close as you'll get in modern versions of PG. > "show timezone" always returns the client's time zone.=20 AFAIK that would only be true if some part of your client stack is issuing a SET TIMEZONE command. (libpq will do that if it finds a PGTZ environment variable set, but not in response to plain TZ.) If that's true, and you can't/don't want to change it, you could try select reset_val from pg_settings where name =3D 'TimeZone'; regards, tom lane --=20 Sent via pgsql-general mailing list (pgsql-general@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general