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 1qb2WB-00AzXo-67 for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Aug 2023 17:28:43 +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 1qb2WA-009LPg-2q for pgsql-hackers@arkaria.postgresql.org; Tue, 29 Aug 2023 17:28:41 +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 1qb2W9-009LPK-5n for pgsql-hackers@lists.postgresql.org; Tue, 29 Aug 2023 17:28:41 +0000 Received: from out3-smtp.messagingengine.com ([66.111.4.27]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qb2W3-001mFA-SZ for pgsql-hackers@lists.postgresql.org; Tue, 29 Aug 2023 17:28:40 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.46]) by mailout.nyi.internal (Postfix) with ESMTP id F347E5C0090; Tue, 29 Aug 2023 13:28:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Tue, 29 Aug 2023 13:28:31 -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:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm1; t=1693330111; x= 1693416511; bh=D/w6XHtzk3Hu63bN+WN/ZkRG4gF2NxVg7oM1UuYJV9g=; b=1 NitNOhpyjoPI4+6RmpYO8arO1RP2Rh/k7LVz8y2FWvWEqysm4ZrQoXOg+saabZQr PO07RJ8H9CLOn0unVAHgjX04eF320UHrgXXSlEC1KyQsRRwpCLlA2g7pAzyTWe6z Bs+ApglTHJBrmP3KmxEy4IYaaUQCdFnAT/K1OhVoIZKpu9cvZAHb3KYoAJgisS/6 LY+3CTS4/cThJtIirIawlHArfU0j6vRqdOlx4hBc+1d+G5wcEWtLPfgy6/b6MA6g MbGYQl4nuzyBVfnhnoHkwRqGNkMQCpx1N9dLVFu9ZPwuw4nZpk38OEiNa2GY5003 vlZ9fsyruuZ9lJp5zyjJQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedviedrudefiedguddufecutefuodetggdotefrod ftvfcurfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfgh necuuegrihhlohhuthemuceftddtnecunecujfgurhepfffhvfevuffkgggtugfgjgesth ekredttddtjeenucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghr rhgvsegrlhhvhhdrnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffud fftdffffehfffhjeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhn pegvnhhtvghrphhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurf grrhgrmhepmhgrihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdho rhhg X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 29 Aug 2023 13:28:31 -0400 (EDT) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id B03D4A9; Tue, 29 Aug 2023 19:28:28 +0200 (CEST) Date: Tue, 29 Aug 2023 19:28:28 +0200 From: Alvaro Herrera To: Kyotaro Horiguchi Cc: pgsql-hackers@lists.postgresql.org Subject: Re: Strange presentaion related to inheritance in \d+ Message-ID: <20230829172828.5qi2pfbladvfgvsg@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20230829.135334.377739201526442411.horikyota.ntt@gmail.com> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On 2023-Aug-29, Kyotaro Horiguchi wrote: > Attached is the initial version of the patch. It prevents "CREATE > TABLE" from executing if there is an inconsisntent not-null > constraint. Also I noticed that "ALTER TABLE t ADD NOT NULL c NO > INHERIT" silently ignores the "NO INHERIT" part and fixed it. Great, thank you. I pushed it after modifying it a bit -- instead of throwing the error in MergeAttributes, I did it in AddRelationNotNullConstraints(). It seems cleaner this way, mostly because we already have to match these two constraints there. (I guess you could argue that we waste catalog-insertion work before the error is reported and the whole thing is aborted; but I don't think this is a serious problem in practice.) -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "En las profundidades de nuestro inconsciente hay una obsesiva necesidad de un universo lógico y coherente. Pero el universo real se halla siempre un paso más allá de la lógica" (Irulan)