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 1v5ihv-00AoSe-VS for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Oct 2025 10:44:44 +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 1v5iht-007JCq-Oh for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Oct 2025 10:44:42 +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 1v5iht-007JCB-3s for pgsql-bugs@lists.postgresql.org; Mon, 06 Oct 2025 10:44:42 +0000 Received: from fhigh-a3-smtp.messagingengine.com ([103.168.172.154]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1v5ihr-000f7d-07 for pgsql-bugs@lists.postgresql.org; Mon, 06 Oct 2025 10:44:41 +0000 Received: from phl-compute-01.internal (phl-compute-01.internal [10.202.2.41]) by mailfhigh.phl.internal (Postfix) with ESMTP id B1787140010D; Mon, 6 Oct 2025 06:44:36 -0400 (EDT) Received: from phl-mailfrontend-02 ([10.202.2.163]) by phl-compute-01.internal (MEProxy); Mon, 06 Oct 2025 06:44:36 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kurilemu.de; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :reply-to:subject:subject:to:to; s=fm3; t=1759747476; x= 1759833876; bh=xP0jrQMsui4VqCfI7cGNSy08z2nTgAehCPjc+eULXWQ=; b=F aPKCZ0gWc+kFf5ykwpshNQl5PHWDTujhMOSUVx1fpk3lQZCb7Uc0urLIASGhZPGv T19MDP1BMrWs6aaN+j3hNa71YfTe2++7iaGSNzluE3wbKTMpd6drtGdeGPN4bjIU qe8MIe5GDnkjdu4IRcEZtokh/3EYuSP7C+2OPaqXibTTiepQJ/0jkKAhCCvPj9xC hXlcQ6pi4BOZIKorEj2ERZHPp6DfxJjre8DnH3BEgAOEBRYgzNHDlkTILF/Uqft8 Go99Y7Vfv4xx2OWvrkP8hlszUwVwvMLM8tLv9azpwAjKJOTwwamokymVdo/CnqjN yF9qlEsCVKbzNBzHIdupw== 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=fm2; t=1759747476; x=1759833876; bh=x P0jrQMsui4VqCfI7cGNSy08z2nTgAehCPjc+eULXWQ=; b=if4BWZJBbxwbB5VZa I/+0WkleZz+RKkJTBP2v5tK+/lxFUkQ+7QATcMudHRVqNDCPNsB9F3xzN9M37QlO SZbtRnE5MqhVmoKzrUGb87KZDIhjYDxabRkw+EUh8nSXnISgMc2Qi4SkJLtYD502 D6vbw7i8pBS67sPSJmQ0YNK2W8T/hKK1no9CwGwf1F4v055qpRxsET+vAhPll6aU dyiJtKn23e+yIkhToOrdbs6AZClg9JoqFvPF+p6O08ETpGNoI0FjvI++C7XxqzRQ vefOf/IP0FE6marDC1nrWDKts7r+xlkhZuI3e8mP96W+BzYPsAcJb63f9CbleJth 4h+iQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeffedrtdeggdeljeeffecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpuffrtefokffrpgfnqfghnecuuegr ihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkgggtugfgjgesthekredttd dtjeenucfhrhhomheplmhlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsehk uhhrihhlvghmuhdruggvqeenucggtffrrghtthgvrhhnpeetuedvheffkeevgfeuheevte evkefggedttdeufeeuheduuddthfeffffhjeefffenucffohhmrghinhepvghnthgvrhhp rhhishgvuggsrdgtohhmnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrghmpehmrg hilhhfrhhomheprghlvhhhvghrrhgvsehkuhhrihhlvghmuhdruggvpdhnsggprhgtphht thhopeegpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopegrnhgurhgvfigsihhllh gvsehgmhgrihhlrdgtohhmpdhrtghpthhtohepughgrhhofihlvgihmhhlsehgmhgrihhl rdgtohhmpdhrtghpthhtohepughilhhiphgsrghlrghuthesghhmrghilhdrtghomhdprh gtphhtthhopehpghhsqhhlqdgsuhhgsheslhhishhtshdrphhoshhtghhrvghsqhhlrdho rhhg X-ME-Proxy: Feedback-ID: ie3de48e3:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Mon, 6 Oct 2025 06:44:36 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kurilemu.de; s=schmee; t=1759747468; bh=Dhj1HXh6vDcPG5DGEnA1tG1XuXkRHJCYh2geL/2uP8c=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=Co3AAqM1DrYPVLvEXDOZVQR0UHxU25oomHE0+xS7hgAvnJGnNO7P+IJrgYqpGKHZE 4E8e/a4gLFN1XcOM7K6cR1ye8ePuCq1h97Kqv5tz/JQRTypf7YOwQfKNZQnJ3ZTnUx o3+6jcZbaWqkUaJXVdMPxZBkvxASast4He4vQrCDf4iG3imYxmqgQSsnnHVD81K5Q2 jLNgzIM7ou9C4wkHqo853Jui1Kj0yIgTJ+e0R3DtVOSdHrzUBfm9bq1EPpDBpGTUiG AxEfQ6fHPLM+8y3dhnEBdOoppA8g8bH/5kJd1tIKhzjV4Kj2T0rLV2acFB+WMNS70f mula4hniLWqJg== Received: by schmee.kurilemu.internal (Postfix, from userid 1000) id 1D0A278; Mon, 06 Oct 2025 12:44:28 +0200 (CEST) Date: Mon, 6 Oct 2025 12:44:28 +0200 From: =?utf-8?Q?=C3=81lvaro?= Herrera To: Dilip Kumar Cc: David Rowley , andrewbille@gmail.com, pgsql-bugs@lists.postgresql.org Subject: Re: BUG #19074: pg_dump from v18 loses the NOT NULL flag in the inherited table field when dumping v17-databases Message-ID: <202510061043.hjzm5ixk5tfs@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-Oct-06, Dilip Kumar wrote: > While quickly checking this commit, it seems the problem is that > before this commit we had a simple logic to add an additional ALTER > TABLE to SET NULL, if the attribute has a not null constraint but the > the parent from which it is inherited doesn't have not null constraint > [1]. Whereas after this commit, it seems we removed this ALTER > command and tried to add the not null constraint while creating the > inherited table itself, which is fine. But here the logic to identify > whether the constraint is local or not for v17 is not correct [2], it > sets "notnull_islocal", only if the "attislocal" is true, which seems > to be wrong. Because the test case given in this bug the attribute is > not local but it is marked not null. Ah, right, the column is indeed not local, but the constraint is. I think this means we need to use flagInhAttrs to require the constraint to be printed ... looking. -- Álvaro Herrera PostgreSQL Developer — https://www.EnterpriseDB.com/