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 1pmOP6-0003eN-Gq for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Apr 2023 00:32:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pmOP5-0002Ey-73 for pgsql-bugs@arkaria.postgresql.org; Wed, 12 Apr 2023 00:32:03 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pmOP4-0002Ep-Um for pgsql-bugs@lists.postgresql.org; Wed, 12 Apr 2023 00:32:02 +0000 Received: from wout4-smtp.messagingengine.com ([64.147.123.20]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pmOP2-002KsC-9V for pgsql-bugs@lists.postgresql.org; Wed, 12 Apr 2023 00:32:02 +0000 Received: from compute5.internal (compute5.nyi.internal [10.202.2.45]) by mailout.west.internal (Postfix) with ESMTP id E55C932009FB; Tue, 11 Apr 2023 20:31:56 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute5.internal (MEProxy); Tue, 11 Apr 2023 20:31:57 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= cc:cc:content-type:content-type:date:date:from:from:in-reply-to :in-reply-to:message-id:mime-version:references:reply-to:sender :subject:subject:to:to; s=fm3; t=1681259516; x=1681345916; bh=8S 8N9N4d+HZOY8rxm3YaSgq8l/HrB7O6U2iA5Io0Tbo=; b=EVkw3eG4dOQrgsXZfO IzrKODTu/HQEPOMHhwxzgp5drhRwQKTmclG1okOlIp5+fye7VKvqi9T+5dT1HnhO GxaVtJLLOkd8Eie4A8wiiwwZUKTJTEG9X30jUo33beoJVLGGZQs/2bLcXkTQ+qvV +IFwXAK0wAaD4O4BuhlsK+Q0cMz1NGUdbCASovWPfo8yND1qhon3jnPxBB8n/FJU Vi9pfalIisb+AaRzZGL1Bqm2sP51zf73b2XW9LupWuSl69E5CyD8r/XCA1V8o6pI SlLON5cly9lzi6QRJ3tR1pfh5204dF+14jBZSh/wmp8MhopcViE6o1DGyujIwsoe HcsA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc: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:sender:subject :subject:to:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; t=1681259516; x=1681345916; bh=8S8N9N4d+HZOY 8rxm3YaSgq8l/HrB7O6U2iA5Io0Tbo=; b=bOgB60O5YRy8KnXcDEIPy1rKxXmxj t790ywIUkUOauJrP6k/4h5+Z4O1H3fcph/MBK/FycDHs8xrH89GLpwSWIJrwxFJD AgsKAUbQIbz6z9B/80RLKnWzz/VnLl6+KQWNWlghRlcNtzN60hRiHy8G23CY3Fkv 13evkIlfZwyUt5PhnZyBNP32D09M9FL3hMx6pg64xVjle6/44X7sLq70FFpD1maz 6+QH+7eVIqxq85JhQXi/HafOLI5LiZ1LoDJAp/6p/EMmU4TN+FF1OYX+Fk/3eW52 dAiMNMz9DJQ5w2OuNqIY8nryoPyKZPe6rmqFU99P8lX1Rn+FFgG9M8cLw== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvhedrvdekhedgfeeiucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne gfrhhlucfvnfffucdljedtmdenucfjughrpeffhffvvefukfhfgggtuggjsehgtderredt tddvnecuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesph grqhhuihgvrhdrgiihiieqnecuggftrfgrthhtvghrnhepteelieefudffhffhtdetleeg geegfffhkeeuveetiefgudduvedutefggeeivdejnecuvehluhhsthgvrhfuihiivgeptd enucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesphgrqhhuihgvrhdrgiih ii X-ME-Proxy: Feedback-ID: i0fe9450f:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 11 Apr 2023 20:31:54 -0400 (EDT) Date: Wed, 12 Apr 2023 09:31:51 +0900 From: Michael Paquier To: Tom Lane Cc: Richard Guo , Alvaro Herrera , PostgreSQL mailing lists Subject: Re: ERROR: no NOT NULL constraint found to drop Message-ID: References: <4031605.1681134419@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="6pUwFNPFCi1SLC68" Content-Disposition: inline In-Reply-To: <4031605.1681134419@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --6pUwFNPFCi1SLC68 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Mon, Apr 10, 2023 at 09:46:59AM -0400, Tom Lane wrote: > It's still good to know about it for next time. The issue I guess is > that LIKE with no options propagates column attnotnull bits, but not > constraints, so we now have an inconsistency: t2.c has attnotnull set > but there is nothing in pg_constraint to justify it. It seems to me > we're going to have to think about what we want to happen in this > case. In a green field we'd probably not propagate NOT NULL unless > told to copy constraints ... but is it okay to break functional > compatibility with the old behavior? I am not sure about that, TBH, though I would tend to not break compatibility just for the sake of breaking it. Anyway, shouldn't we have a test that does a DROP NOT NULL after a LIKE copies it? At least, we'll be able to track that. -- Michael --6pUwFNPFCi1SLC68 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAmQ1+/cACgkQnvQgOdby QH3+cw//UqWKkSFwwnL18Cg5hiTEyPLUwsOUGD4+DD3GtsbK5OudKAxxqvxstkG+ k9Iwc779YdXi/JYkIFg80giBPCke2JnlI62ygGulHiIbsKF5IlWPO3vcqwuj/ykd Lp2++nmQSReTPdZImTwPQuDZEsgflw+nKev8bZhEixgIee1uJRVJ4NmufBQDn0sq wESTvLw5DVo67jI4TQ9TY2tj0eVyLF7cBLL50sY+A57A/uyoudeWC0zzDSdrFIbp FenmTzzQPgjdv+BznOiWlxODCG4ssezYGsJyqaJiMhKTm7XV6ijPCbjeab8uHoHy KSt5l2C+BRUNtFTkQRNEQeF6mOSDcjxMt5uHV0EbWMSALcbnOPVJTpxbhOg29Yku gyuwXn0Q4rGHtHZkTqPmlyeQrj7b+/7TjwcHJlfM6Jp9K6ld4uawZ3jqIfccM4/u KcnPRzzqXkiR6iaUIy6T1lcTqIHEE5AM9aocTfZOOR28wxrbeBQayKIKurTusuZ7 cWdDuWreCVfNfWAR581p86ve96kJ8XvBpCX6dzxSeFlngxo7MsA/h47org3hLyFa x30KRPRQpsOgItnio/jx460SJzaMXfizACgouEhPsIWnwEv19NxkaC0o4nExL2P4 qB9y6qWSwhtlFiKQp6lAAOt/Vk5LOsvLPXZl041bdbF3g0tR9IM= =FI/n -----END PGP SIGNATURE----- --6pUwFNPFCi1SLC68--