Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pG0Qj-0004X8-2k for pgsql-general@arkaria.postgresql.org; Thu, 12 Jan 2023 16:27:53 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pG0Qh-00080i-M5 for pgsql-general@arkaria.postgresql.org; Thu, 12 Jan 2023 16:27:51 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pG0Qh-00080Y-B5 for pgsql-general@lists.postgresql.org; Thu, 12 Jan 2023 16:27:51 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pG0Qe-0002aP-Ra for pgsql-general@lists.postgresql.org; Thu, 12 Jan 2023 16:27:50 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id D8A925C00F8; Thu, 12 Jan 2023 11:27:47 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 12 Jan 2023 11:27:47 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= cc:cc:content-transfer-encoding:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to; s=fm2; t=1673540867; x= 1673627267; bh=qlCZjYko+PZ4yaAtuzJ6F2UHTeUK/+iEdFRIuzXi2/g=; b=I XHTHfiLtIEZi2N0Y+aruPWe8mn33wRf49hpNlC0SFp+hzcxUDWmWr7D0/9qZJshx IAS4j8rHO0R9c4GFeQgWAJP8pvJK1NIyCE7Wzn0ihhXaceMpZK+SOszjoGyBqZ+l IkVM7rnnbFp+7fjj9iO2pLvaneOELAC5IdaCv/pDfDz/rQBZWi7zdMW34BTyTeIy s+70DYJQwhR1EAp4W5WViztfsTKv2ybfSyw7qGHXuWkE85OPPf+S/D+jKwoYzPxS etiDqv0+IdhMapvApgg20quqlOztb0V8/mjEIhh/jrv3NkrEiF4nvKM5sHnQgE3c SUW6q4NzqPZZXNVHrpjbA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:date:date:feedback-id:feedback-id:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1673540867; x= 1673627267; bh=qlCZjYko+PZ4yaAtuzJ6F2UHTeUK/+iEdFRIuzXi2/g=; b=s l9iZ2xdnrZaQbqEbVAGdbWaj/NGuBBe62xQxKAgj/g6tzxmXwrWIdFG9kssYQP+B gcE0aPANU67lPNEJJdUBluSwLHQrVewoBOs4oAsB9PJqKx+1QvVIsm6NPGls4Ali n1ZeAhsxpM8UDvC7eeDlUcDJHJvjzRyFp56QIKHJBW3VG+nwc9ug5XN83K7lHp1Z dj0JSCK0yP2bfFzVAslafZSVsqbez/Z5EYdEGfbTNm56hug4DSy2YG8abR68L/4G 6bvCbv+PjmxUS/Mp/JY1pIoZ5oVGJ1NZdqOy1PO/cpmUErHnR/TAjQRU0vqZE5m8 0Q2z63WwualgXjGg7FgVw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrleeigdekkecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefkffggfgfuvfevfhfhjggtgfesthekredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeehudfgtefhtedtheeiveetueektdejvdfhveekgfdu feegveetuddvuedvgeeggeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Feedback-ID: i76984098:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 12 Jan 2023 11:27:47 -0500 (EST) Message-ID: <95af71c3-2d32-352e-cd7c-9cd276aee607@aklaver.com> Date: Thu, 12 Jan 2023 08:27:46 -0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.6.1 Subject: Re: Changing displayed time zone in RAISE NOTICE output? Content-Language: en-US To: Pavel Stehule Cc: Ron , pgsql-general References: <6b5f2616-f44a-10c5-974d-fc19cc493473@gmail.com> <0ccb4bf8-2f7f-7455-49ac-ff06cda36438@aklaver.com> <6a7ddac2-48e1-7339-5919-a69d6d7801ae@gmail.com> From: Adrian Klaver In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 1/12/23 08:22, Pavel Stehule wrote: > > > čt 12. 1. 2023 v 16:39 odesílatel Adrian Klaver > > napsal: > > On 1/11/23 21:25, Ron wrote: > > On 1/11/23 15:06, Adrian Klaver wrote: > > > > > Hmm.  I'd have sworn this didn't work when I tried it: > > Did you do?: > > DO $$ > BEGIN > RAISE NOTICE '%', clock_timestamp() at timezone 'UTC'; > END$$; > ERROR:  syntax error at or near "timezone" > LINE 3: RAISE NOTICE '%', clock_timestamp() at timezone 'UTC'; > > > there should be space >>AT TIME ZONE<< > > (2023-01-12 17:21:10) postgres=# DO $$ > BEGIN > RAISE NOTICE '%', clock_timestamp() at time zone 'UTC'; > END$$; > NOTICE:  2023-01-12 16:21:14.063256 > DO > (2023-01-12 17:21:14) postgres=# Yeah I know, I was responding to Ron saying his previous attempt had failed. Using 'timezone' instead of 'time zone' is a mistake I have made often enough that I threw it out there as a possible cause for the failure. > > > > > > postgres=# > > postgres=# DO $$ > > BEGIN > > RAISE NOTICE '%', clock_timestamp() at time zone 'UTC'; > > END$$; > > NOTICE:  2023-01-12 05:22:40.517299 > > > > But it does work, so all's well that ends well. > > > > -- > Adrian Klaver > adrian.klaver@aklaver.com > > > -- Adrian Klaver adrian.klaver@aklaver.com