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 1so1Yd-007jAC-RY for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 14:09:28 +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 1so1Yd-00DgCw-HM for pgsql-hackers@arkaria.postgresql.org; Tue, 10 Sep 2024 14:09:27 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1so1Yd-00DgCo-7U for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2024 14:09:27 +0000 Received: from fout6-smtp.messagingengine.com ([103.168.172.149]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1so1Ya-000Tb4-Al for pgsql-hackers@lists.postgresql.org; Tue, 10 Sep 2024 14:09:26 +0000 Received: from phl-compute-01.internal (phl-compute-01.phl.internal [10.202.2.41]) by mailfout.phl.internal (Postfix) with ESMTP id E05AA1380254; Tue, 10 Sep 2024 10:09:23 -0400 (EDT) Received: from phl-mailfrontend-01 ([10.202.2.162]) by phl-compute-01.internal (MEProxy); Tue, 10 Sep 2024 10:09:23 -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=fm1; t=1725977363; x= 1726063763; bh=NAN6iuwkqIiMPSFItBUO+vYkr+LbDMmRy7J2MLmoSNU=; b=X iAhxnwuJAB19MSGxmR80cQmQmMTzd642r9cutVcOQIPwfB0PzY3YLF09YgS/FhQy el/nLaNLE26nYEC+5ZPFIt0zDpgTztL/xTj2xYNaHr+yqJnX6B3N0zVkOoV6NSr4 dLYjw2dTcU6nXwvZghnYe9uPQ4Qhx5mEuUQ0QT24cVxcSPpSbg47SmJZvEqM5lro suUDoVoPIMe3HikeVa9EePxbrgfaDAkbVyGhMz9sCvpVp2WgSZIpXEWxqIoCEX5J 9Pu7ZoP1shGWQ3huVLJelCN+Gl6dMFm5oi3PxobD//q9HM6rxve/1vhUmOXH805n kT5IsGk7re1Nmo1Ex0EoA== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeeftddrudeiledgieehucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdggtfgfnhhsuhgsshgtrhhisggvpdfu rfetoffkrfgpnffqhgenuceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnh htshculddquddttddmnecujfgurhepfffhvfevuffkgggtugfgjgesthekredttddtjeen ucfhrhhomheptehlvhgrrhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhh drnhhoqdhiphdrohhrgheqnecuggftrfgrthhtvghrnhepvdektdffudfftdffffehfffh jeejhffgieeuueekjeekfffgudffhfduffffueevnecuffhomhgrihhnpegvnhhtvghrph hrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgr ihhlfhhrohhmpegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgpdhnsggprh gtphhtthhopedvpdhmohguvgepshhmthhpohhuthdprhgtphhtthhopehtnhgurhifrghn ghesghhmrghilhdrtghomhdprhgtphhtthhopehpghhsqhhlqdhhrggtkhgvrhhssehlih hsthhsrdhpohhsthhgrhgvshhqlhdrohhrgh X-ME-Proxy: Feedback-ID: ia2694551:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Tue, 10 Sep 2024 10:09:23 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alvh.no-ip.org; s=schmee; t=1725977360; bh=3DAG4eSLiKn03E85vwJns4R7/+XpTSpSeKhbtugYwG8=; h=Date:From:To:Cc:Subject:In-Reply-To:From; b=L0yYDKCm1d1hwfj52NwyysOQOV6fejiyBkv7goJVYut/ypfTd4R0L6e3bd5ElKqEM Hxc7jtkowPzdtmqQbH7F8G7ErX/47kDlggy/ekMKIOsncPHI1Z3Fg2BjJ3+bfFNcm5 Cq/3kADp5NdfSy5xdxaIIyT4nWaVu4WY9iLJ0YmfHXojitwJU8xIGiauBDAIGp25HL UBUDJLyolKZCPKEC4mnn/em2QxAmVYuu/xifh0Cvsoqd3dobiYl58FmQaxwZzJY6ZR K0eZE8zJXJyVyE1aWhvMwGcdP5nLPK6+Y9B/bjSoyHv0HfHlT2FFbiOkoqzno0FWnk 4DAphkpk5u15A== Received: by schmee.alvh.no-ip.org (Postfix, from userid 1000) id 684DAD3D; Tue, 10 Sep 2024 11:09:20 -0300 (-03) Date: Tue, 10 Sep 2024 16:09:20 +0200 From: Alvaro Herrera To: Tender Wang Cc: Pg Hackers Subject: Re: not null constraints, again Message-ID: <202409101409.sy4gg7tlktcp@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-Sep-02, Tender Wang wrote: > The attached patch adds List *nnconstraints, which store the not-null > definition, in struct CreateStmt. This makes me a little confused > about List *constraints in struct CreateStmt. Actually, the List > constraints store ckeck constraint, and it will be better if the > comments can reflect that. Re-naming it to List *ckconstraints seems > more reasonable. But a lot of codes that use stmt->constraints will be > changed. Well, if you look at the comment about CreateStmt, there's this: /* ---------------------- * Create Table Statement * * NOTE: in the raw gram.y output, ColumnDef and Constraint nodes are * intermixed in tableElts, and constraints and nnconstraints are NIL. After * parse analysis, tableElts contains just ColumnDefs, nnconstraints contains * Constraint nodes of CONSTR_NOTNULL type from various sources, and * constraints contains just CONSTR_CHECK Constraint nodes. * ---------------------- */ So if we were to rename 'constraints' to 'ckconstraints', it would no longer reflect the fact that not-null ones can be in the former list initially. -- Álvaro Herrera 48°01'N 7°57'E — https://www.EnterpriseDB.com/ "No hay ausente sin culpa ni presente sin disculpa" (Prov. francés)