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 1truwv-00BRu5-LN for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 08:26:53 +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 1truwu-00Aynl-8l for pgsql-hackers@arkaria.postgresql.org; Tue, 11 Mar 2025 08:26:52 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1truwt-00Aynd-O3 for pgsql-hackers@lists.postgresql.org; Tue, 11 Mar 2025 08:26:51 +0000 Received: from fhigh-b1-smtp.messagingengine.com ([202.12.124.152]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1truwq-002BrO-2z for pgsql-hackers@lists.postgresql.org; Tue, 11 Mar 2025 08:26:50 +0000 Received: from phl-compute-08.internal (phl-compute-08.phl.internal [10.202.2.48]) by mailfhigh.stl.internal (Postfix) with ESMTP id A973125401C1; Tue, 11 Mar 2025 04:26:47 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-08.internal (MEProxy); Tue, 11 Mar 2025 04:26:47 -0400 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 :reply-to:subject:subject:to:to:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm1; t=1741681607; x=1741768007; bh=H JBVICaROxcZgrIc8q7wECXBc9Y1DzJuOrUivRhiksM=; b=41fl7KEgNROy0nnB0 OGImTzZrjeN8LK14IWdh1alKWtYiDe8W8K5NECW3jMiTrxonAUHoZeBp/asGsOSY 5iehud7/ZzyfiKdjOSoH53EmU6xVh5TVXSiTqvBW6dxCXQ2Dpk3h2hJr5m7+3G1C PpoxTLU9tzpX7bAdqFQk67CgxaA+mvCHr44rPlrodXCmV/NoW+gaqMTWJnSXLGOE jYu8/AZHYJxN7jSFf88ipU8YimoKbL9/lIw/1oh7dTPlk9JCfnfzYazD8JLuQ1cT fed9VDOtenDziaOI4pgFR2BSqXM7JjFmqG6uh+K+djKxsEatHtgSpAOKxhFvLCoo pYgyw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeefvddrtddtgdduvddujeegucetufdoteggodetrf dotffvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggv pdfurfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpih gvnhhtshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddt jeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlh hvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdehueffhefgueekueef heehgffhuefgfedukeejveduffegffekgeffffevgeehnecuffhomhgrihhnpegvnhhtvg hrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhep mhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsg gprhgtphhtthhopeehpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehpvghtvghr segvihhsvghnthhrrghuthdrohhrghdprhgtphhtthhopehnrghthhgrnhgusghoshhsrg hrthesghhmrghilhdrtghomhdprhgtphhtthhopehsuhhlrghmuhhlsehgmhgrihhlrdgt ohhmpdhrtghpthhtohepphhgshhqlhdqhhgrtghkvghrsheslhhishhtshdrphhoshhtgh hrvghsqhhlrdhorhhgpdhrtghpthhtohepthhglhesshhsshdrphhghhdrphgrrdhush X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Mar 2025 04:26:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1741681603; bh=ig9NaRJhaIcQgzMTLvNgQ1+rP1YFqAlT0xXaF6ZYXg4=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=iGGsZSlqUeymlXipATsFfSitF51lw8xg9apEZW4NqTfw019st0U7xgQJYt+UBstsE Hui+FA5lvbSIHyK5QMC+ZZLetWJ6UFh33jluo3u6YJAOX3yHhD4dxaru8BewCeSuOf sruGMw+YcQnXy4GpvAOKjCfWfJIsRWQmfG79qh5fqBbfUwSg3WCgv+YAPEvRvOlq1t CRKqZIj4waLzH2dLXFHrOfAORVrjNy/88d9FCIJ9gaHy9LF/We7rRnIOJ3md73ZCj8 6VOFXEDripa477WKBXo9puxwVKZ8lDBlzzLdkqA2UItLay6yxGkhCMpasrAkZNVAiO Z/2CdT4XV0TPg== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id CFB6C91; Tue, 11 Mar 2025 09:26:43 +0100 (CET) Date: Tue, 11 Mar 2025 09:26:43 +0100 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Amul Sul Cc: Tom Lane , Pg Hackers , Peter Eisentraut , Nathan Bossart Subject: Re: bogus error message for ALTER TABLE ALTER CONSTRAINT Message-ID: <202503110826.ttskpa5mokuu@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2025-Mar-11, Amul Sul wrote: > On Mon, Mar 10, 2025 at 11:29 PM Álvaro Herrera wrote: > > > I fleshed this out more fully and I think 0001 is good enough to commit. > > The approach looks good to me, but instead of adding a CAS_flags struct, could > we use macros like SEEN_DEFERRABILITY(bits), SEEN_ENFORCEABILITY(bits), > etc.? We can simply pass cas_bits to these macros, and to avoid the error > from processCASbits(), we can pass NULL for constrType. Ah yeah, I thought of this too at first, but didn't actually code it because I thought it'd be messier. Trying to do it naively doesn't work, because it's not enough to test whether each bit is true or false -- what you need to know is whether an option was specified for each bit, in either direction. So we'd need a separate bitmask, we can't pass the existing 'bits' mask. And at that point, it's not any better to have a bitmask, and a stack-allocated struct of booleans is just easier to write. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Los dioses no protegen a los insensatos. Éstos reciben protección de otros insensatos mejor dotados" (Luis Wu, Mundo Anillo)