Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNwIp-00HGLI-MC for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2024 14:45:05 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1rNwIo-00CLN6-7f for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2024 14:45:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNwIm-00CLMf-7m for pgsql-hackers@lists.postgresql.org; Thu, 11 Jan 2024 14:45:01 +0000 Received: from out5-smtp.messagingengine.com ([66.111.4.29]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rNwIh-0011hI-Kb for pgsql-hackers@lists.postgresql.org; Thu, 11 Jan 2024 14:44:59 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id 74E745C0239; Thu, 11 Jan 2024 09:44:53 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Thu, 11 Jan 2024 09:44:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eisentraut.org; h=cc:cc:content-transfer-encoding:content-type:content-type :date:date:from:from:in-reply-to:in-reply-to:message-id :mime-version:references:reply-to:subject:subject:to:to; s=fm1; t=1704984293; x=1705070693; bh=evUW5G/4hLIJqwHyPP97ghjrEsYKXUJr 9b85pu/iOXc=; b=lrS1x+wzfDwnvxVY80uIMfdaTF/h7yKs/vKD8aIPP9YV4ej9 DPMwESa4JjUHznIaItp/EJeWlfAA4Dzu+9Y32l1b4bLTJzgmrROSLCSs+LyRaZSh WdVz7bkDuWkV2BAlbJmPFGqriUKDa9aGZPiCbzrVwGmnaVxdZ8XSBhXh/AfTcDGa P3Qg28h4peAuZpAUI2iWjQwu/mOH13juaoECIN9sclaN7wwESo1rILgq1vmlmCsH YbOiEuLJCTN9non6qsKNz3p4IvGh9nj5YnKVPy8aGTtE7VDwIDz+qbhpQxTSdPNr ucj9qX4CF6MWDX/ExoUaRnJ/8uQcWwMr3RnH1g== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm2; t=1704984293; x= 1705070693; bh=evUW5G/4hLIJqwHyPP97ghjrEsYKXUJr9b85pu/iOXc=; b=F pOfPDbYmtRVvN3VZiqrrO8w0gNM+Crjx3ON1z075EPv1VRWdXCMFylsSK95t1HiV mV3wiyQGHCf6UDvwJ3WQH2xFB/xFIOVzD6SfF+cTSz+S3FUCC8rRLyNDQkfyKN/z gFgDQEyYQqVibAY+0ypMP6RY4VXmTcLpXJyXCVTYeBMLf/nj92sTSu3/TzBK+SYk 80fjg9DRyFfRZSKkhuZ3HAI0n4tlGHHA0UW8UW4EU9TO2YMEiaYyl73ezH0zkWCu Vb8/U+QJy7I2g7c9JZPT6UQjCCsCJjUYqRkfvjerEqnFLk5rrFWosnmN1NpCkdeQ nOin+fafxVSYljB0pqUqA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvkedrvdeifedgieejucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepkfffgggfuffvvehfhfgjtgfgsehtkeertddtvdejnecuhfhrohhmpefrvght vghrucfgihhsvghnthhrrghuthcuoehpvghtvghrsegvihhsvghnthhrrghuthdrohhrgh eqnecuggftrfgrthhtvghrnhepjefhveehtdetgfffhffhfeefgffghffflefgieeuueek hedvhedvfeehffdvfeeunecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomhepphgvthgvrhesvghishgvnhhtrhgruhhtrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 11 Jan 2024 09:44:52 -0500 (EST) Message-ID: <7be8724a-5c25-46d7-8325-1bd8be6fa523@eisentraut.org> Date: Thu, 11 Jan 2024 15:44:50 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2011 application time Content-Language: en-US To: Paul Jungwirth , jian he Cc: PostgreSQL Hackers References: <2d9740ad-3bb7-473c-8441-344351caa8ee@illuminatedcomputing.com> <596fefdd-6202-4228-b7c6-f240b1cbe06e@eisentraut.org> <35400587-6865-4a2c-9ea4-4761669478ea@eisentraut.org> <71b45adb-b496-4e58-b134-0a091014e63f@illuminatedcomputing.com> From: Peter Eisentraut In-Reply-To: <71b45adb-b496-4e58-b134-0a091014e63f@illuminatedcomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 31.12.23 09:51, Paul Jungwirth wrote: > On Wed, Dec 6, 2023 at 12:59 AM Peter Eisentraut > wrote: > > > > On 02.12.23 19:41, Paul Jungwirth wrote: > > > So what do you think of this idea instead?: > > > > > > We could add a new (optional) support function to GiST that translates > > > "well-known" strategy numbers into the opclass's own strategy numbers. > > > > I had some conversations about this behind the scenes.  I think this > > idea makes sense. > > Here is a patch series with the GiST stratnum support function added. I > put this into a separate patch (before all the temporal ones), so it's > easier to review. Then in the PK patch (now #2) we call that function to > figure out the = and && operators. I think this is a big improvement. I like this solution. Here is some more detailed review of the first two patches. (I reviewed v20; I see you have also posted v21, but they don't appear very different for this purpose.) v20-0001-Add-stratnum-GiST-support-function.patch * contrib/btree_gist/Makefile Needs corresponding meson.build updates. * contrib/btree_gist/btree_gist--1.7--1.8.sql Should gist_stratnum_btree() live in contrib/btree_gist/ or in core? Are there other extensions that use the btree strategy numbers for gist? +ALTER OPERATOR FAMILY gist_vbit_ops USING gist ADD + FUNCTION 12 (varbit, varbit) gist_stratnum_btree (int2) ; Is there a reason for the extra space after FUNCTION here (repeated throughout the file)? +-- added in 1.4: What is the purpose of these "added in" comments? v20-0002-Add-temporal-PRIMARY-KEY-and-UNIQUE-constraints.patch * contrib/btree_gist/Makefile Also update meson.build. * contrib/btree_gist/sql/without_overlaps.sql Maybe also insert a few values, to verify that the constraint actually does something? * doc/src/sgml/ref/create_table.sgml Is "must have a range type" still true? With the changes to the strategy number mapping, any type with a supported operator class should work? * src/backend/utils/adt/ruleutils.c Is it actually useful to add an argument to decompile_column_index_array()? Wouldn't it be easier to just print the " WITHOUT OVERLAPS" in the caller after returning from it? * src/include/access/gist_private.h The added function gistTranslateStratnum() isn't really "private" to gist. So access/gist.h would be a better place for it. Also, most other functions there appear to be named "GistSomething", so a more consistent name might be GistTranslateStratnum. * src/include/access/stratnum.h The added StrategyIsValid() doesn't seem that useful? Plenty of existing code just compares against InvalidStrategy, and there is only one caller for the new function. I suggest to do without it. * src/include/commands/defrem.h We are using two terms here, well-known strategy number and canonical strategy number, to mean the same thing (I think?). Let's try to stick with one. Or explain the relationship? If these points are addressed, and maybe with another round of checking that all corner cases are covered, I think these patches (0001 and 0002) are close to ready.