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 1lqL5k-0006ca-7v for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 19:39:20 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lqL5j-0002NC-7y for pgsql-general@arkaria.postgresql.org; Mon, 07 Jun 2021 19:39:19 +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 1lqL5i-0002N3-Vc for pgsql-general@lists.postgresql.org; Mon, 07 Jun 2021 19:39:18 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lqL5h-0000yY-54 for pgsql-general@postgresql.org; Mon, 07 Jun 2021 19:39:18 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 157JdF4O983172; Mon, 7 Jun 2021 15:39:15 -0400 From: Tom Lane To: Joe Conway cc: David Gauthier , Postgres General Subject: Re: Need to omit time during weekends from age calculations In-reply-to: References: Comments: In-reply-to Joe Conway message dated "Mon, 07 Jun 2021 15:34:56 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <983170.1623094755.1@sss.pgh.pa.us> Date: Mon, 07 Jun 2021 15:39:15 -0400 Message-ID: <983171.1623094755@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Joe Conway writes: > On 6/7/21 3:12 PM, David Gauthier wrote: >> I'd like to get the "age" difference between two times which span either >> all or part of a weekend but exclude any time that transpired during the >> weekend. I'm a bit suspicious of this problem statement. I doubt there are many practical applications where you wouldn't also wish to exclude holidays, for somebody's definition of holidays. Of course, that makes it a lot messier since you need a source of data for that. regards, tom lane