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 1fGrhA-0003cZ-2P for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 19:57:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fGrh8-0003mW-Cd for pgsql-general@arkaria.postgresql.org; Thu, 10 May 2018 19:57:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGrh7-0003mG-9v for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 19:57:42 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fGrh2-0000bd-Jk for pgsql-general@lists.postgresql.org; Thu, 10 May 2018 19:57:40 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6836322993; Thu, 10 May 2018 15:57:34 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Thu, 10 May 2018 15:57:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=relops.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=mesmtp; bh=0aVx4ya/tKQPPr3qBkX6ksm4C4 7EZMOa0VoI3OOlDZs=; b=G2FykNnUaEZnErMlBylD09sbS7bVZI5Vz4PshPPKwd LnBb4wMpRjD9lHqF3USh6q1SprF0vkVa54Jr3Mhw2BAU2N7ADHCeMOsJ2EHSsto6 5ZKfWEQNj2GQ4nFbs2y7FwzGVhBOxepf9XQnzAdRT1ZAf4I+B3Q46tALz4Jr6n7H E= 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=0aVx4y a/tKQPPr3qBkX6ksm4C47EZMOa0VoI3OOlDZs=; b=GnB6V3UVRmCml5qXBpY8Xz XjNcNwUqsf7N5C/Ga0kRcXHa4P3HxMJMlOGTxXdze0QoqqKWMu6/LjoK2n7wiWOx bnHLHb+t2v4hsND0M2rpkSiDEQehtNtrRwU9mxxn7CKn3HXXeGMVBm/x6j+EkYmH 2L/eo4HqpLE9oCqb8PUS1c4Mtok5TvpARZM7O7i5+Yn6YjRJHACIf8toqmZfSTf+ vjO2Kp4m91Q/9418h6E9sqwDEOo4ODKpFxL7q45rfz/tM0TtccWhBbyD8MxfXOWM zlRvqCTUYMoBtD7CRRuSN7QRBzqwjUHVMWyoMnbGinu4UVMCUrOZs63FL+XjPmYg == X-ME-Sender: Received: from [172.20.10.3] (unknown [148.252.128.195]) by mail.messagingengine.com (Postfix) with ESMTPA id 42304E444A for ; Thu, 10 May 2018 15:57:33 -0400 (EDT) From: Ben Hood Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Mime-Version: 1.0 (Mac OS X Mail 11.3 \(3445.6.18\)) Subject: Re: Domain based on TIMEZONE WITH TIME ZONE Date: Thu, 10 May 2018 20:57:23 +0100 References: <06EAD729-DC35-4E48-AB25-C42F7FA19C28@relops.com> <188A0270-0A9A-4ADE-A928-9067E99AE7B7@relops.com> <20180510103608.GB3622@hermes.hilbert.loc> To: pgsql-general@lists.postgresql.org In-Reply-To: Message-Id: <06BC29A5-4A10-4FB7-A801-FC9A2B43947D@relops.com> X-Mailer: Apple Mail (2.3445.6.18) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk > On 10 May 2018, at 18:29, Adrian Klaver = wrote: >=20 > 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. That=E2=80=99s very true, I hadn=E2=80=99t thought of that. The use case I have is a schema that unites billing events from = disparate telecoms systems from a bunch of different carriers. The = source of the non-specific timestamps is party input data files that = provide different local timestamps for systems in different systems, but = also different apps that submit billing events. So there are many = inconsistent feeds into the database. So when we push the ambiguity into the app, at least what is happening = is the the transaction is rejected which means the app breaks. When the = app breaks, we can go in and fix the timestamp bug in the particular = app. Often this is difficult, and we need to reason about the source = data, but the breakage at least tells us that something is wrong. = Otherwise we ingress the data, do complex billing queries and then the = only time we find out about a bug is when a customer complains about a = particular bill. When this happens, it is really difficult to determine = whether there is a bug in the query logic or if the input is bogus. So in this sense, the database is linting the the source data.=