Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGpNO-00008y-9D for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 17:29:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGpNL-0007XF-TW for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 17:29:07 +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.89) (envelope-from ) id 1fGpNK-0007X5-JV for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 17:29:07 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGpNH-0004zO-CW for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 17:29:05 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 3302E2254B; Thu, 10 May 2018 13:29:02 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Thu, 10 May 2018 13:29:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=aklaver.com; h= content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=fm2; bh=gaycNBiAjZTmUN5pLFmVtRQ45ykC5 wT298WNGFrsMoo=; b=PMh7k31HFta1ajXwpV2/h3niV77xqkztzysMKfG4lf4fB yMgEfkv4lt6svRFsoLQtQI38Nz/cKuOfI8aw89OfeKJ7jtXkrqewtG6bn9Gc+Plw nfxbdYQf0ivSzBNqEmWXdZSL6Q4zV6QuJd1+EOwW+XvZxXRXMsk+JcgYOuD5jNLS 1Y4cSpy6Ma5cBROEtwgP4DqiOgLEP1QkVpM7Qr4QQagMRrXiHTXKSie/OgrbqxqH vxAkkes5P0KZe2j/6EQTu10lByR9UT8md9+tAuRU67UfP9U1cmuGlHhW1zTrunC5 LdTK9iCyK0p+9BEnhyw2X/OTxwN+t1ASa+1jT3y5g== 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-sender:x-me-sender:x-sasl-enc; s=fm2; bh=gaycNB iAjZTmUN5pLFmVtRQ45ykC5wT298WNGFrsMoo=; b=YB6F7Lo6XF5hNVvLyvHbnK 0WHEDzpkjX1WW+qJEJG8mEaRbHxkJo0lJMfhXB4V4gtvcvqlOvIITl96LF10PuQG ZqONS8oDTce32WR1No5wcZIMuYNFaZwCcPx5CSjjMbYDAJFuA4Wdz6HKb0p97xdm 4OBSTXd1t7GH3+by8zNSq6iPpDX+p3LoDbdzDPOm31GEIsGbhWbFQk0fQXfoD/iH LrXIhjarzD5I9vDpffEJyvJOmn0wBz48UUhwv3KFFoxaAGqsMGPSLdYIHT9IljJc cvJTOT68newJYWama/NVuBLSwSI/ZrSG4M9P4L5frqUf6zbhrHa9BItlEia5Oyrg == X-ME-Sender: Received: from ranger.suse (c-73-239-117-238.hsd1.wa.comcast.net [73.239.117.238]) by mail.messagingengine.com (Postfix) with ESMTPA id 9A16BE4393; Thu, 10 May 2018 13:29:01 -0400 (EDT) Subject: Re: Domain based on TIMEZONE WITH TIME ZONE To: Ben Hood , pgsql-general@lists.postgresql.org References: <06EAD729-DC35-4E48-AB25-C42F7FA19C28@relops.com> <188A0270-0A9A-4ADE-A928-9067E99AE7B7@relops.com> <20180510103608.GB3622@hermes.hilbert.loc> From: Adrian Klaver Message-ID: Date: Thu, 10 May 2018 10:29:00 -0700 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.7.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 05/10/2018 09:13 AM, Ben Hood wrote: > >> On 10 May 2018, at 15:12, Vick Khera > > wrote: >> >> On Thu, May 10, 2018 at 7:31 AM, Ben Hood > > wrote: >> >> Or are we saying that domains are one way of achieving the >> timestamp hygiene, but equally, you can get the same result as >> described above? >> >> >> The *only* way to have timestamp hygiene is to require them to have >> time zones at all times, even if that time zone is UTC. Any other >> representation of a time is ambiguous without context. > > That makes sense. > > The motivation behind narrowing the built in TIMESTAMP WITH TIME ZONE > down to a domain is to ensure the only permissible zone offset is UTC. > This would be unambiguous. Per my previous post a timestamp with timezone is going to be stored as UTC, so there is no ambiguity there. On reflection I realized your concern maybe with determining the original input timezone. That information is not stored by Postgres, so there can be ambiguity as to their value. Doing all timestamps in UTC is one one way to eliminate this. The potential issue I see is that you now push the ambiguity into the app. Namely just from looking at the database values you still do not know what the original timezone the app lives in is. -- Adrian Klaver adrian.klaver@aklaver.com