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 1oQUeu-0003IN-L6 for pgsql-general@arkaria.postgresql.org; Tue, 23 Aug 2022 14:13:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1oQUet-0005gV-DU for pgsql-general@arkaria.postgresql.org; Tue, 23 Aug 2022 14:13:35 +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 1oQUet-0005gM-2g for pgsql-general@lists.postgresql.org; Tue, 23 Aug 2022 14:13:35 +0000 Received: from mout-u-204.mailbox.org ([2001:67c:2050:101:465::204]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oQUep-0006HI-D2 for pgsql-general@lists.postgresql.org; Tue, 23 Aug 2022 14:13:33 +0000 Received: from smtp202.mailbox.org (smtp202.mailbox.org [IPv6:2001:67c:2050:b231:465::202]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-384) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-u-204.mailbox.org (Postfix) with ESMTPS id 4MBrmR2Rqxz9sRM; Tue, 23 Aug 2022 16:13:11 +0200 (CEST) Date: Tue, 23 Aug 2022 16:13:10 +0200 (CEST) From: Erik Wienhold To: "Peter J. Holzer" , pgsql-general@lists.postgresql.org Message-ID: <1524824843.599258.1661263990654@office.mailbox.org> In-Reply-To: <20220823123852.xfws3vcxbmdlxrns@hjp.at> References: <20220823123852.xfws3vcxbmdlxrns@hjp.at> Subject: Re: Support for dates before 4713 BC MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Priority: 3 Importance: Normal List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On 23/08/2022 14:38 CEST Peter J. Holzer wrote: > > > On 2022-08-23 10:25:12 +0100, Simon Riggs wrote: > > On Mon, 22 Aug 2022 at 11:14, stefan eichert wrote: > > > In order to deal with all dates, historical and prehistoric ones, in > > > a consistent way, the implementation of timestamps/dates for before > > > 4713 BC would be very helpful, as we really do have dates before > > > 4713 BC we are working with, that in some cases also have > > > information on months respectively days. > > > > One possibility is to store dates as the INTERVAL datatype, using the > > convention for Before Present, rather than worrying about BC/AD. > > > > create table arch (i interval year); > > insert into arch values ('-5000 years'); > > select * from arch; > > > > i > > ------------- > > -5000 years > > [Disclaimer: I am not an archeologist] Me neither ;) > I think this works well if you know an approximate age. If something is > about 5000 years old now, it will still be about 5000 years old next > year and even in ten years. > > But it breaks down if you already have a relatively precise date. > > 4980 years before now probably should be 4981 years before now next year > and definitely 4990 years before now in ten years. So you would have to > continuosly update those values. Would be easier to store the estimated age and the assessment date so the age doesn't have to be updated until it's reassessed. The time from assessment to now can be handled as you described: either the age is still considered roughly the same or it increases as time between assessment and now increases. -- Erik