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 1rxUXz-009AHP-A8 for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:23:39 +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 1rxUXx-006jws-NV for pgsql-hackers@arkaria.postgresql.org; Thu, 18 Apr 2024 16:23:37 +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 1rxUXx-006jwf-CZ for pgsql-hackers@lists.postgresql.org; Thu, 18 Apr 2024 16:23:37 +0000 Received: from fout2-smtp.messagingengine.com ([103.168.172.145]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1rxUXu-001ecz-Hm for pgsql-hackers@lists.postgresql.org; Thu, 18 Apr 2024 16:23:36 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailfout.nyi.internal (Postfix) with ESMTP id 0DADE13800EE; Thu, 18 Apr 2024 12:23:33 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Thu, 18 Apr 2024 12:23:33 -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-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1713457413; x= 1713543813; bh=M1Nw8dim1omW4ljO60giGK9+rdC+xyOP7jMeeSZD1XA=; b=h VTkvitNVcXQ3gAPS3KkfzuWzGTjtcFge77eU9vQ34v6Q4yHViUtx12phvmh20hbv SieHYCfQdGm5yudyVvEokcinIE3UETrKqxGdJGFm7Cg6qPVqknMkXAiIbsJjebRc kRNABURe0Z8wCoy2pic0+nR1SeEPHD39U9dcFyMnSbUIFzVAsJBp3+2EpJWikFtO EKLnSTSmGxAEsWtwa5vLe8yTrSmQbwqFvHfamp3sonX8IXDR0XYIjPaKYDIH3pNI 9/Ry4C/ZOt4B57FnjzrMQIFhA35AU8zy10dSS6+ndgHBHUDcCBgt3F1dsJkul+D7 NSKGXXaTpxVF7gJgg2UTQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudektddguddttdcutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmd enucfjughrpeffhffvvefukfggtggugfgjsehtkeertddttdejnecuhfhrohhmpeetlhhv rghrohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorh hgqeenucggtffrrghtthgvrhhnpedvkedtffduffdtffffheffhfejjefhgfeiueeukeej keffgfdufffhudffffeuveenucffohhmrghinhepvghnthgvrhhprhhishgvuggsrdgtoh hmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghl vhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 18 Apr 2024 12:23:32 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1713457411; bh=ftOhtSoZ+c9f14HN2krPeionYNln6mQRqCMaTaDCljI=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=oEof/Djw3oFLmJS3wrXkIN+j/dB41Sd50cvBjLQuCIbQYTO6qywlTpyDWtiUN058n WbwMP6VP23LWmarlmzocUmTU/CBKinKwuIycsVmuywNIrIvjQw1PSg3UtWjdUUBY9H AE7RNebX6PjmDV6rWJ1sLcZsZHf34Hm1TPMe6wwimuUFOC7P3WW/Qae3ZmgI83pxa1 7d2r61eGYLQxb8hZMZd2+hnhPurHY91bxrrpQGQNCzH1wvD7rJ5iV/LCDJGSucieWK kKlGsZ5A0pnx3MJdUkPJoZmG2R0RcZZnQAj0oe9gZ+/KIkUwiIsdi/ihVziTXriNG4 o4U7017W3abAw== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 00C5F385; Thu, 18 Apr 2024 18:23:30 +0200 (CEST) Date: Thu, 18 Apr 2024 18:23:30 +0200 From: Alvaro Herrera To: Justin Pryzby Cc: Kyotaro Horiguchi , pgsql-hackers@lists.postgresql.org Subject: Re: pg17 issues with not-null contraints Message-ID: <202404181623.lkhdxun6r7sp@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 2024-Apr-18, Justin Pryzby wrote: > That seems like it could be important. I considered but never actually > test your patch by pg_upgrading across major versions. It would be a welcome contribution for sure. I've been doing it rather haphazardly, which is not great. > BTW, this works up to v16 (although maybe it should not): > > | CREATE TABLE ip(id int PRIMARY KEY); CREATE TABLE ic(id int) INHERITS (ip); ALTER TABLE ic ALTER id DROP NOT NULL; > > Under v17, this fails. Maybe that's okay, but it should probably be > called out in the release notes. Sure, we should mention that. > | ERROR: cannot drop inherited constraint "ic_id_not_null" of relation "ic" > > That's the issue that I mentioned in the 6 year old thread. In the > future (upgrading *from* v17) it won't be possible anymore, right? Yeah, trying to drop the constraint in 17 fails as it should; it was one of the goals of this whole thing in fact. > It'd still be nice to detect the issue in advance rather than failing > halfway through the upgrade. Maybe we can have pg_upgrade --check look for cases we might have trouble upgrading. (I mean: such cases would fail if you have rows with nulls in the affected columns, but the schema upgrade should be successful. Is that what you have in mind?) > I have a rebased patch while I'll send on that thread. I guess it's > mostly unrelated to your patch but it'd be nice if you could take a > look. Okay. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/ "Industry suffers from the managerial dogma that for the sake of stability and continuity, the company should be independent of the competence of individual employees." (E. Dijkstra)