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 1n4I49-00010e-3q for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jan 2022 07:47:37 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n4I46-00020u-HT for pgsql-hackers@arkaria.postgresql.org; Mon, 03 Jan 2022 07:47:34 +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 1n4I44-00020k-PL for pgsql-hackers@lists.postgresql.org; Mon, 03 Jan 2022 07:47:34 +0000 Received: from out1-smtp.messagingengine.com ([66.111.4.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n4I3x-0000sR-Q1 for pgsql-hackers@lists.postgresql.org; Mon, 03 Jan 2022 07:47:31 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.nyi.internal (Postfix) with ESMTP id 7E3875C0183; Mon, 3 Jan 2022 02:47:24 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute3.internal (MEProxy); Mon, 03 Jan 2022 02:47:24 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm3; bh=exWBbeCETViYEjuZfx2Fbb2Pezj mtu+n9qNuJKSjfnE=; b=bVvSFnB8sVfiApD9GBynnXTBp+BBATUrIk0NcXbVNtL AYgG3jPI8Z8Sfwyo+EHY+9WUxbc4GNdTiU6R5NBO/JITRg90M/yqwzRE4LG42otJ 7mYlc4Qu7gqawrieDnEpQsIU6JZyvfUWTYFGG0SdSJS7WVIsSyRqdzjLMINH4lxO SdoncMCaWlsvtVLk9dixUIidkXD4TK32PaWxLCwioQWC9LFyAsbSF5fSgAfgSbnz 25WO0ogaduqG0XAZfT81rXN6o++/XYwsz8ARwuKQbX4/tuI8Pi6GeOUFaBiVQDYq I9Oog1i3ulLY4ufNAhYfxbqg0uMNRC53Fm7UjNfCYaw== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm1; bh=exWBbe CETViYEjuZfx2Fbb2Pezjmtu+n9qNuJKSjfnE=; b=EVMzfubwQ/Hra3uNN84pgd wNUOZ1gLEKPoe7Kw3iBCvIlfO8CTjjlen1qhrM9whRhLQbLrjoL/r9KVI3BNklV3 R3Pm2vOhE8LJEELmjvhheQeWW4RAH/lhnLrrezVzceGPzN2vGgnkhkK8Jq4kXjWK e4viXOu31zCAe7RYwzcrHw/tuTTtQMZUmlLf7GNjp4Qg2ztl1sIBm3Gp3jtzDbgz lOi1yeTYw+3NneVlbIOdcIXee/w9syhA6yr4ddbvmw+DDT8uuZEpsnsAwz4AlPa8 fCqq5I7wevIv/M0HA61BnSKOG6CFTpbiWe6NZfw/TBUffh/Eizln8Y5Ri612WvvQ == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvuddrudeftddgudduudcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enfghrlhcuvffnffculdefhedmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepvdegudeuhfdtueeltedtveej heehieevueeigeelteegleejleeiueeiheegvefhnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 3 Jan 2022 02:47:21 -0500 (EST) Date: Mon, 3 Jan 2022 16:47:17 +0900 From: Michael Paquier To: "houzj.fnst@fujitsu.com" Cc: Euler Taveira , "wangw.fnst@fujitsu.com" , Ashutosh Bapat , "pgsql-hackers@lists.postgresql.org" Subject: Re: Confused comment about drop replica identity index Message-ID: References: <53e4a0d4-4b7b-4001-99c3-576bc03f73ef@www.fastmail.com> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="GEWNonCC60WFW7YC" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --GEWNonCC60WFW7YC Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Thu, Dec 30, 2021 at 06:45:30AM +0000, houzj.fnst@fujitsu.com wrote: > I think forbids DROP INDEX might not completely solve this problem. Becau= se > user could still use other command to delete the index, for example: ALTER > TABLE DROP COLUMN. After dropping the column, the index on it will also be > dropped. >=20 > Besides, user can also ALTER REPLICA IDENTITY USING INDEX "primary key", = and in > this case, when they ALTER TABLE DROP CONSTR "PRIMARY KEY", the replica > identity index will also be dropped. Indexes related to any other object type, like constraints, are dropped as part of index_drop() as per the handling of dependencies. So, by putting a restriction there, any commands would take this code path, and fail when trying to drop an index used as a replica identity. Why would that be logically a problem? We may want errors with more context for such cases, though, as complaining about an object not directly known by the user when triggering a different command, like a constraint index, could be confusing. -- Michael --GEWNonCC60WFW7YC Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmHSqgUACgkQnvQgOdby QH06yhAAoC7R+/FMT3VdLHNGmvj5mRU2Y9jUS2oe7vUl7i9Kke3449t3iAr7S1ay M/CbiVZedkF8U+bOZigOxbwwvaJeS7Mv8pKWt2SRgY305zj1HPPIRd8hqXgyYclp VEJd/jM9J9OIFvM4xKkL3QfvV72W7KB8iJeKNfrLXs2vY0QBAmgon8zlZ1m62e94 U7mYrLwlgmtw/t0RICPncfj76lZLWwQt40dVbGWevUhKHZgNUu6C3nM+02igBEoy n/dTzU9muk9LxRqtBIyYj862CqtL37Wg+IdjKrynQsJ7iZEdoEfFb5+629B7tF0g tL9h7ILLredOGZ4HwZEoYCT/Z4GnPw5JLVuX5sNJRuTP92HtMvP/K97HpnunFd+7 /2wVK7jJUCOJGEwMQkmFECYB08h/fLDmr3f3PZXQxHSU0d08KP3znqzZ39EQZo9H Wnc3x2RXilnr6aBx7NdZJJVn7uapIttbrzZ9HOcsQlHT4KbUNsQXUNVYXL5Vvg7Y Ok8ZocdH9P9+U6GPfIyK4NpMUYF/lFUvdeGOtD72zrLZoUQpqW+HeDfIRsFSU+SD Jouy0Fcbd9aDNn1qsps0C6FMLknQSJ153th0Za5LnPtQSwe4q1X8jB4EN9VMYpix /a7cU+XLp1kwCfxBnYJi0a/whBScp2YG9/7TmNFZoIqgkWp912w= =Nl6D -----END PGP SIGNATURE----- --GEWNonCC60WFW7YC--