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 1lRcWh-0004l5-GM for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Mar 2021 15:13:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lRcWg-0003b3-Ct for pgsql-bugs@arkaria.postgresql.org; Wed, 31 Mar 2021 15:12:58 +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 1lRcWe-0003aw-QP for pgsql-bugs@lists.postgresql.org; Wed, 31 Mar 2021 15:12:58 +0000 Received: from [66.111.4.26] (helo=out2-smtp.messagingengine.com) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lRcWc-0008Fz-1U for pgsql-bugs@postgresql.org; Wed, 31 Mar 2021 15:12:55 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id ECD7C5C00A2 for ; Wed, 31 Mar 2021 11:12:42 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute4.internal (MEProxy); Wed, 31 Mar 2021 11:12:42 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=imap.cc; h=to :from:subject:message-id:date:mime-version:content-type :content-transfer-encoding; s=fm2; bh=uJuJ9JeopZP3kJqWNAtwzag4qm /VeCH9FQ/RjNYk4s0=; b=Ln4HCTu+d98Mk6H9vjdkgdRMYkgzdTsOWg+yvPbYxh 5xx3iHwzNURKCqb51GfxxpOPu4l4D+cmlry1fV+RPLmTFGXq4vRkPnvsbytL+bzF an+9uocWw8pAzhW9jcFoby2cPy+qRQ0tLRS2kz9TTiFYoSz97IwRxDikhU8p3NOt 3mDNWv0Jy5BR9g/8UWCjCgCSMfj3lI7tU43iuk4gOJKXsqAo9I+5pB3byBW58naO Ce1Axcif1E4PezxqtL+aj85SkWCd0qtpNZwJFwE0Tu7zLHUN+ff1lnocBaED9zJ1 qX0xybuuY85qOIIcYHjB+/pOmHsj9ACSX5aEKwMtjlag== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-transfer-encoding:content-type :date:from:message-id:mime-version:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=uJuJ9J eopZP3kJqWNAtwzag4qm/VeCH9FQ/RjNYk4s0=; b=d0JASF6BRgaX8HS3J+IqyS uWcAq5sWLgFgcjfJLp8Ge3ybYOq8ts7N5HUWheVqtsKxp+h9Vid/PIyQ/RVR41Al NgdOSucJyIRyCeLEaTIrCxmRv62oyN4R3HUAnTI1yiQpqxafmCviBGnIGbZarCXj IjdbQVB1MLUzKnDeduYqOwnPI5MMRBM9KrLTu/8x/pKFsaxF+IT0McvlQFCl3n6g 5gZx3+mF0A50EBZlnfKfthLOsvp1omwvBMzDH3wtKHmQDVvZhPHFKqUpSUS7Y8Ze D7zoNHxPxwqHbSDMEhNsX6WSoA6uO73YY62JeuLjkDNHEE69dQsE2+rue6cdrCBw == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrudeivddgkeekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucgfrhhlucfvnfffucdlfedtmdenucfjughrpefvhf fukffffgggtgfgsehtjeertddtfeejnecuhfhrohhmpeetlhgvgigvhicuuegrshhhthgr nhhovhcuoegsrghshhhtrghnohhvsehimhgrphdrtggtqeenucggtffrrghtthgvrhhnpe ekkeeihfejtdehffffgfeuveelteevhfejvdetffehkeelgeefueefteevkeevueenucfk phepjeelrdejledrudejvddrkeegnecuvehluhhsthgvrhfuihiivgeptdenucfrrghrrg hmpehmrghilhhfrhhomhepsggrshhhthgrnhhovhesihhmrghprdgttg X-ME-Proxy: Received: from ev9d9.btn1.brandwatch.net (unknown [79.79.172.84]) by mail.messagingengine.com (Postfix) with ESMTPA id 5AE9A24005D for ; Wed, 31 Mar 2021 11:12:42 -0400 (EDT) To: pgsql-bugs@postgresql.org From: Alexey Bashtanov Subject: should all not-null constraints be inherited? Message-ID: Date: Wed, 31 Mar 2021 16:12:40 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US X-Host-Lookup-Failed: Reverse DNS lookup failed for 66.111.4.26 (deferred) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, This is how one can create a parent with a non-nullable column and a child with the same column nullable: create table t1(a int not null); create table t2() inherits (t1); alter table t2 alter column a drop not null; insert into t2 select null; pg_dump produces a dump that fails to restore, as the change by the alter command doesn't get addressed. Reproduced in 10 and 14devel. Should we fix ALTER TABLE or pg_dump? Best, Alex