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 1u58qr-00CtUI-Ed for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Apr 2025 19:55:17 +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 1u58qo-004SmQ-Fj for pgsql-hackers@arkaria.postgresql.org; Wed, 16 Apr 2025 19:55:15 +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 1u58qo-004SmI-6Y for pgsql-hackers@lists.postgresql.org; Wed, 16 Apr 2025 19:55:15 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1u58ql-000Rnw-30 for pgsql-hackers@lists.postgresql.org; Wed, 16 Apr 2025 19:55:14 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 53GJt9R92057836; Wed, 16 Apr 2025 15:55:09 -0400 From: Tom Lane To: Alvaro Herrera cc: Tender Wang , jian he , Pg Hackers Subject: Re: not null constraints, again In-reply-to: <202504161124.4ypvhzbnecbm@alvherre.pgsql> References: <202504161124.4ypvhzbnecbm@alvherre.pgsql> Comments: In-reply-to Alvaro Herrera message dated "Wed, 16 Apr 2025 13:24:13 +0200" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <2057834.1744833309.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Wed, 16 Apr 2025 15:55:09 -0400 Message-ID: <2057835.1744833309@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Alvaro Herrera writes: > Here's another version where I do skip searching for children twice, and > rewrote the comments. v2 LGTM, with two small nits: 1. Grammar feels shaky here: + * normal case where we're asked to recurse, this routine ensures that th= e + * not-null constraints either exist already, or queues a requirement for= them + * to be created by phase 2. The "either" seems to apply to "ensures" versus "queues", but it's in the wrong place for that. Maybe something like + * normal case where we're asked to recurse, this routine checks if the + * not-null constraints exist already, and if not queues a requirement fo= r + * them to be created by phase 2. 2. Stupider compilers are likely to whine about the "children" variable possibly being used uninitialized. Suggest initializing it to NIL. regards, tom lane