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 1lMJYG-0007o1-4U for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 23:56:41 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lMJYF-0001Bm-3f for pgsql-bugs@arkaria.postgresql.org; Tue, 16 Mar 2021 23:56:39 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMJGK-0004IM-Fb for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 23:38:08 +0000 Received: from ppsw-32.csi.cam.ac.uk ([131.111.8.132]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lMJGH-0006O3-V5 for pgsql-bugs@lists.postgresql.org; Tue, 16 Mar 2021 23:38:07 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=cam.ac.uk; s=20180806.ppsw; h=Content-Transfer-Encoding:Content-Type:MIME-Version:Date: Message-ID:Subject:From:To:Sender:Reply-To:Cc:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: In-Reply-To:References:List-Id:List-Help:List-Unsubscribe:List-Subscribe: List-Post:List-Owner:List-Archive; bh=4/fDDOE920To+xmDi3w+vWCiXuZvySIAj2FdL6X1GUc=; b=Qx0lxRZxZYPLuilBw1atfxDHBP Z9q/e3JZT9m/PKj/DERw0FwjPCI/z6FW7Sf0J9CMZVXgUK2oYkque+LIKINgJMP+97gOCEL7scBgP l8yjSWnpr2p921OA+LSqk+J+2jBBediLNSaB8mW3DQVYVXiuPa27EcwBOuj9nXSORWKg=; X-Cam-AntiVirus: no malware found X-Cam-ScannerInfo: http://help.uis.cam.ac.uk/email-scanner-virus Received: from cpc91250-cmbg18-2-0-cust30.5-4.cable.virginm.net ([82.8.243.31]:43850 helo=[192.168.0.37]) by ppsw-32.csi.cam.ac.uk (smtp.hermes.cam.ac.uk [131.111.8.156]:587) with esmtpsa (PLAIN:rn214) (TLS1.2:ECDHE-RSA-AES128-GCM-SHA256:128) id 1lMJGF-000k8r-0P (Exim 4.94) for pgsql-bugs@lists.postgresql.org (return-path ); Tue, 16 Mar 2021 23:38:03 +0000 To: pgsql-bugs@lists.postgresql.org From: Richard Neill Subject: Wish: support "quarter" in Interval Message-ID: <6b2a4293-6f88-8114-aa0f-d7becdaafbdf@cam.ac.uk> Date: Tue, 16 Mar 2021 23:38:02 +0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 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 Hello, May I make a request that "Quarter" should be treated as a valid Interval (as a synonym for "3 months"), to be consistent with other date functions that allow it, such as date_trunc() and extract() ? #1. 'quarter' is valid for date_trunc() and extract() SELECT date_trunc ('quarter', now()); date_trunc ------------------------ 2021-01-01 00:00:00+00 SELECT EXTRACT ('quarter' FROM now()); date_part ----------- 1 #2. But, 'quarter' is invalid for interval SELECT '1 quarter'::interval; ERROR: invalid input syntax for type interval: "1 quarter" I would expect it to give exactly the same result as for 3 months: SELECT '3 months' :: interval; interval ---------- 3 mons * As an aside: it might also be useful to support "half" (which half of a year), or interval of 6 months, and the interval of "fortnight" = 14 days. I'm testing this on version 13.2: SELECT version(); version ------------------------------------------------------------------------- PostgreSQL 13.2 (Ubuntu 13.2-1) on x86_64-pc-linux-gnu, compiled by gcc (Ubuntu 10.2.1-19ubuntu1) 10.2.1 20210206, 64-bit Thank you very much for your consideration. Richard