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 1tBALm-002Et8-CO for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Nov 2024 10:11:50 +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 1tBALj-00D0vr-Bz for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Nov 2024 10:11:47 +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 1tBALh-00D0vj-Rq for pgsql-hackers@lists.postgresql.org; Wed, 13 Nov 2024 10:11:47 +0000 Received: from fout-a5-smtp.messagingengine.com ([103.168.172.148]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1tBALd-001hRn-Ra for pgsql-hackers@lists.postgresql.org; Wed, 13 Nov 2024 10:11:45 +0000 Received: from phl-compute-04.internal (phl-compute-04.phl.internal [10.202.2.44]) by mailfout.phl.internal (Postfix) with ESMTP id BFE79138026B; Wed, 13 Nov 2024 05:11:40 -0500 (EST) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-04.internal (MEProxy); Wed, 13 Nov 2024 05:11:40 -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=fm2; t=1731492700; x=1731579100; bh=+tFyq1Doo2cPT8kEfTBg2oQGDIrXHQ3I gR5jTpSh19I=; b=q5Dxgv+inXBDQru/dJOr6jbrW9EOcQFJLqP4NAEtVFIHriB+ Q9aJ9Asu2YIW22w91IC6xEi4/iETimjJ4dAO18y2CriV/5Rbbt+sQtCMNvad/Moc 9y2OwTPHbaK195ahW4XIHhFAOMQIVJAQBgJI7kxQS5F/TDfCGiDz4qxfIIPxqFjU hkb0zgnmXIPa2P9cgGayf4E5JruFbrscFEtDHycMVN3KBVdvv2Qu9bS28wEZ3eXg 9lnbvv5DMrR3kk6eyI9HXRWRMvA5MXoGSmTBOQpTRLYJRQkEMbhu5SO3c6bQ2568 hvkv4JtxpNXAAfnaYiUDuR/nI/ReG/Ux9QaLPg== 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-sender:x-me-sender:x-sasl-enc; s=fm3; t=1731492700; x= 1731579100; bh=+tFyq1Doo2cPT8kEfTBg2oQGDIrXHQ3IgR5jTpSh19I=; b=L AaF4/bh7Coj3MuagpI58AONALwA7MRZoFjaKU04RZP+0OModffSYes344m+U3Cdk LJ92qjuGMgC0A6KqDMjt0a4dKxv0HAZXY7ahgit5d4MNvgnSt9z/vzBKhoTLDslD 4SEF3QZTajNNkCK1vgkAdeg4hMZaBB6zBjpS+CNTkg2k3cshjcERIFXzEa7xlKKk Tz9J96gOqGz6eglCbkFfiAFLtCR3nhVVPZgSpLJwjPRdVzFLyAjka1aOzeqhlM1U YVEc0QE8sQ+nazExBvbgk4H4VI1MgbTWzM1WCwQtnP663HkysDfGy7PfPVCgplp/ QJCsiSWuzaTiL1XMhHajg== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefuddrvddtgddufecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpggftfghnshhusghstghrihgsvgdpuffr tefokffrpgfnqfghnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnth hsucdlqddutddtmdenucfjughrpefkffggfgfuvfevfhfhjggtgfesthejredttddvjeen ucfhrhhomheprfgvthgvrhcugfhishgvnhhtrhgruhhtuceophgvthgvrhesvghishgvnh htrhgruhhtrdhorhhgqeenucggtffrrghtthgvrhhnpefgjedthfekfedtuefgieelheet leejgefhueeltdfhueetvdffudekfeejhfegheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehpvghtvghrsegvihhsvghnthhrrghuthdrohhr ghdpnhgspghrtghpthhtohepfedpmhhouggvpehsmhhtphhouhhtpdhrtghpthhtohepph hjsehilhhluhhmihhnrghtvggutghomhhpuhhtihhnghdrtghomhdprhgtphhtthhopehj ihgrnhdruhhnihhvvghrshgrlhhithihsehgmhgrihhlrdgtohhmpdhrtghpthhtohepph hgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtghhrvghsqhhlrdhorhhg X-ME-Proxy: Feedback-ID: ie0a040ee:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 13 Nov 2024 05:11:39 -0500 (EST) Message-ID: <6dc196d4-8853-49d7-8dd3-e391058451c1@eisentraut.org> Date: Wed, 13 Nov 2024 11:11:37 +0100 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: SQL:2011 application time To: Paul Jungwirth Cc: jian he , PostgreSQL Hackers References: <30dc3561-d7ab-42be-a1c5-096643423590@illuminatedcomputing.com> <73d09e24-b6b9-4c89-8c0a-8842ca0f81f9@illuminatedcomputing.com> <081aa43c-3a97-4bd5-a498-ba02e0a7570d@illuminatedcomputing.com> <54390149-11d6-4f52-bbe8-f69832ceb3bd@eisentraut.org> <9b7cb814-c78c-489f-85b2-32be4398647f@illuminatedcomputing.com> <95c6d49b-7d60-4ad0-820c-e00ae1b2a3d4@illuminatedcomputing.com> <57ea0668-5205-426e-b934-efc89f2186c2@illuminatedcomputing.com> Content-Language: en-US From: Peter Eisentraut In-Reply-To: <57ea0668-5205-426e-b934-efc89f2186c2@illuminatedcomputing.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk I have committed the documentation patches v43-0001-Add-WITHOUT-OVERLAPS-and-PERIOD-to-ALTER-TABLE-r.patch v43-0002-Update-conexclop-docs-for-WITHOUT-OVERLAPS.patch For the logical replication fixes v43-0003-Fix-logical-replication-for-temporal-tables.patch can you summarize what the issues currently are? Is it currently broken, or just not working as well as it could? AFAICT, there might be two separate issues. One is that you can't use a temporal index as replica identity, because ALTER TABLE rejects it. The other is that a subscriber fails to make use of a replica identity index, because it uses the wrong strategy numbers. This conditional is really hard to understand: + /* + * The AM must support uniqueness, and the index must in fact be unique. + * If we have a WITHOUT OVERLAPS constraint (identified by uniqueness + + * exclusion), we can use that too. + */ + if ((!indexRel->rd_indam->amcanunique || + !indexRel->rd_index->indisunique) && + !(indexRel->rd_index->indisunique && indexRel->rd_index->indisexclusion)) Why can we have a indisunique index when the AM is not amcanunique? Are we using the fields wrong? - return get_equal_strategy_number_for_am(am); + /* For GiST indexes we need to ask the opclass what strategy number to use. */ + if (am == GIST_AM_OID) + return GistTranslateStratnum(opclass, RTEqualStrategyNumber); + else + return get_equal_strategy_number_for_am(am); This code should probably be pushed into get_equal_strategy_number_for_am(). That function already has a switch based on index AM OIDs. Also, there are other callers of get_equal_strategy_number_for_am(), which also might want to become aware of GiST support. For the new test file, remember to add it to src/test/subscription/meson.build. Also, maybe add a introductory comment in the test file to describe generally what it's trying to test.