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 1mSh4I-0007ev-AY for pgsql-general@arkaria.postgresql.org; Tue, 21 Sep 2021 14:48:22 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mSh4H-0004bY-1o for pgsql-general@arkaria.postgresql.org; Tue, 21 Sep 2021 14:48:21 +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 1mSh4F-0004bQ-PU for pgsql-general@lists.postgresql.org; Tue, 21 Sep 2021 14:48:20 +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 1mSh4D-0000XG-6H for pgsql-general@postgresql.org; Tue, 21 Sep 2021 14:48:18 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id DD9495C01CE; Tue, 21 Sep 2021 10:48:15 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 21 Sep 2021 10:48:15 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= subject:to:references:from:message-id:date:mime-version :in-reply-to:content-type:content-transfer-encoding; s=fm1; bh=N /XTlpotD8njIToW3PknT6mMbiKjw28I7sh3ALiYP6U=; b=jzyiCAzkaPDfh7YTm uugJPzHBpqVt/pZVBOOdjEk8/zmax6F5IlmtkuFhoSJMvHMG+M3f9s2lGLpMSyso BBkXPbefDNHhYVIOPjCdK1K15fHslGxUPBP63kdWcHicE8sh8EuA9rOLGsih5sIH edaIeLwEjD2GmLu5Yof4Mj8Wcv7Dv4bS/bdNJWMdyZgSoy9VggFOONfNfjDISeQJ /FYBEhZktaBf6aePi2XoTK0A2BN6cJ41ULktlG2bGQykhOCdRT4SScMlhjVCVma1 KVeldBQacWHe8QMKqvCS68F+14D5ZMXnQ5WL9zVwlT+s/VG1Ws1HY54khMhyBoeZ M39gA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=N/XTlpotD8njIToW3PknT6mMbiKjw28I7sh3ALiYP 6U=; b=UBfPERKMfbPZxyboVHakZ6fhZZPk+neioYK42PnkNoa+1EBNj3EwYKlfR b9vqiis+zE20kuvfQeOyTAL0wRgUY2Ao4Dk6L20sG9UnNwsp9jd9M95LP6TksQWK E5m0xWXLqJCotJsWZzqAp5W9Lq/UhcBh2LOWbGaIBgQgNW0jJtkyQOge3Vdo18YR asAlJVgkr96yiwG86zOpt98AX0Ua/4VYgd84dI9+HZZlNTK/7VGN/j9vzQKWdi34 rGLW5yNqlxXkQqn1MLSmEbaOK0sEZJL7mnjTb4bA5D/NrV5JzARF9AE6c432uiSN u4SOCScecPCFmdP6VJFvzdm88ug3A== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrudeigedgkeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepuffvfhfhkffffgggjggtgfesthejredttdefjeenucfhrhhomheptegurhhi rghnucfmlhgrvhgvrhcuoegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtoh hmqeenucggtffrrghtthgvrhhnpeetjedvteffjeeuvdelieeffeehuedthffgvdfhhffh kedvudevgedvjedufefgveenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegrughrihgrnhdrkhhlrghvvghrsegrkhhlrghvvghrrdgtohhm X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 21 Sep 2021 10:48:15 -0400 (EDT) Subject: Re: Timestamp with vs without time zone. To: Tim Uckun , pgsql-general References: From: Adrian Klaver Message-ID: <2b5872f2-502d-369f-3dd6-1f7907883bfc@aklaver.com> Date: Tue, 21 Sep 2021 07:48:14 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.14.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 9/20/21 11:00 PM, Tim Uckun wrote: > I am hoping to get some clarification on timestamp with time zone. > > My understanding is that timestamp with time zone stores data in UTC > but displays it in your time zone. Does this also work on queries? If > I query between noon and 2:00 PM on some date in time zone XYZ does pg > translate the query to UTC before sending it to the server? > > So does the database know the timestamp is in auckland time when the > client is connecting from a server on UTC? My question would be why does it matter? The whole purpose of timestamptz is that you know it is stored as UTC, from there you can transform to whatever time zone you want. -- Adrian Klaver adrian.klaver@aklaver.com