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 1maV9i-0005Kk-Ms for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 03:42:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1maV9h-0002kU-L1 for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Oct 2021 03:42:13 +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 1maV9g-0002kM-7V for pgsql-hackers@lists.postgresql.org; Wed, 13 Oct 2021 03:42:13 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1maV9b-00046Y-4q for pgsql-hackers@postgresql.org; Wed, 13 Oct 2021 03:42:11 +0000 Received: from compute6.internal (compute6.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id A18105C012B; Tue, 12 Oct 2021 23:42:05 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute6.internal (MEProxy); Tue, 12 Oct 2021 23:42:05 -0400 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=ZRWPs1DvzIKzGGfqueo2pRVyzpi 244U/Q3stP8QicOA=; b=tH+szQUMpJNTPsGeBmIyGSoQyfsJkQyPjLK47rX+goY 46BhVz8fZOxzOb6PqfK6zU3GUc1HH1V+wBWPUo3d/vqHQQ94GfO7fCK9R7b9Z4+4 2qHb2rkEGTT1ntDz33+LyOQDKO8TPLaI+1X8Fn+SiMuzZXbz4gOa8EQFrvgFuC9u 6T5BYpyIl4q3fpNdvCuoFheEaazUK35Ptfe+x1GeimynfyecoTHm0C6sr9ciKyCu ffhNpjlxTfMrmvRVyhC2b1/FeHaLrhFXtbI1CesWSkwuZdWwmR+bizP4MPZuq69m 13FI3mWs86AZNcHWKOYm/oKHLzq+dLQyKbWPxwbB6Qw== 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=ZRWPs1 DvzIKzGGfqueo2pRVyzpi244U/Q3stP8QicOA=; b=RD53c86x+lO7l70ITDCPoV /MY4YZ079ZYXU8XnkQx+hOAzk9aOjwXaa4aUw2YPVnkDaPd1+7hJbGYAaUWMaeuM 3Yxx2s6gPClLPlyhA95lReokGe6w+j15EtUPCHvk+cvmMOERLDbqmGroXWpXVc7q IirtFBYuYd9PRMta86Pn0l+/p0XUAVSiG/wy4VUyld1NZbhyS3RBfGRe2LcKU+Rp /ecCqUVm+ugx1Elufz0CnAhjbpCHxA2xwk8OqAoJ4a/gpI1lUeld7PoH0UpzKYGl 6+iI/0sqDTfdbq83u7AJlouIGH8vq2WnTQIavSI1nnrgZepMsGd+aOA+cfbR34sw == X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvtddrvddtledgjeduucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvuffkfhggtggujgesghdtroertddt vdenucfhrhhomhepofhitghhrggvlhcurfgrqhhuihgvrhcuoehmihgthhgrvghlsehprg hquhhivghrrdighiiiqeenucggtffrrghtthgvrhhnpeehgedtueehkeetgeeuvedtleel keeggeefteefjeejgfekheeikeevjeehudejheenucevlhhushhtvghrufhiiigvpedtne curfgrrhgrmhepmhgrihhlfhhrohhmpehmihgthhgrvghlsehprghquhhivghrrdighiii X-ME-Proxy: Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 12 Oct 2021 23:42:03 -0400 (EDT) Date: Wed, 13 Oct 2021 12:42:00 +0900 From: Michael Paquier To: "Bossart, Nathan" Cc: Vik Fearing , "postgresql@zr40.nl" , Alexander Korotkov , "pgsql-hackers@postgresql.org" Subject: Re: BUG #17220: ALTER INDEX ALTER COLUMN SET (..) with an optionless opclass makes index and table unusable Message-ID: References: <17220-15d684c6c2171a83@postgresql.org> <9b91d241-4d05-e5a4-67da-5b8acdb9a2f1@postgresfriends.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="/gM1IjKO/evAPmUj" Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --/gM1IjKO/evAPmUj Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Wed, Oct 13, 2021 at 12:06:32AM +0000, Bossart, Nathan wrote: > At first glance, it looks like ALTER INDEX .. ALTER COLUMN ... SET > uses the wrong validation function. I've attached a patch where I've > attempted to fix that and added some tests. The gap is larger than than, because ALTER INDEX .. ALTER COLUMN .. SET is supported by the parser but we don't document it. The only thing we document now is SET STATISTICS that applies to a column *number*. Anyway, specifying a column name for an ALTER INDEX is not right, no? Just take for example the case of an expression which has a hardcoded column name in pg_attribute. So these are not specific to indexes, which is why we apply column numbers for the statistics case. I think that we'd better just reject those cases until there is a proper design done here. As far as I can see, I guess that we should do things similarly to what we do for SET STATISTICS with column numbers when it comes to indexes. -- Michael --/gM1IjKO/evAPmUj Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIyBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmFmVYgACgkQnvQgOdby QH3jRA/4ybpIg2cfhaTgS8gA60S893E//79IXYMmslJhZSoNLxoG0SThxrd3sNNa jncmaDinlJoEtuYUwiaWS1vNBTrZZE+TKrHf4gxzx6Czj28ltoFgAGDksOZSDcCW 2nnni9hjJEwk7BT+vNHW6MAR8rII4daMmBWdJlBQ9XghSf1Y3WTPb+DGR59ZBD2A ruIIE891npFhgRqUUw+ZutOmjrRuT02H3SB0ChX5+JfUCcC5pywouk3OpLgzsSyi Tn3+KGyeBmxvRAnwcL45Gzcn4D9M7tG+WyXZlUX9xiX1jvEPQV2ksFemLp5+LxZU s0qkAxR7RjecU45frUYnr+p+Bt4v2cUu5/F+Hrj7yZP9ZGIdVj1efEs3f9J5YcD3 ctqIaXM4r27RMXhFVDQYVBaeIp6OgR1A7gXiXRs2z3aLLkf4+S/d/QbbKDoNS01+ LBNnap4Wx5GpCLXtnhBrQEPZ2vVqqxSlERiu2w1uCrV5yRol1XRnA7WZre8rhOG0 iyuFZBqczM77Q9Ot9EL+odHQ/c1Fu4c5JbNC39C5J7wOuXQaa4sMKCv4t3jC07db wdfZtPj1Suel1XeA29jGyqRcZamKu8vskAYJ3E9ojjMn1gUtS8WvLXklEcg3LWxa MLWgP6+6aeADAAXsu+wg8kYHNgSWkNaxH36rtD0tkzKRDYAflQ== =O3W/ -----END PGP SIGNATURE----- --/gM1IjKO/evAPmUj--