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.96) (envelope-from ) id 1wXF2t-0039LG-0M for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 09:16:23 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wXF2s-00ALly-0C for pgsql-hackers@arkaria.postgresql.org; Wed, 10 Jun 2026 09:16:22 +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.96) (envelope-from ) id 1wXF2r-00ALlq-2X for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 09:16:21 +0000 Received: from mail-pj1-x1035.google.com ([2607:f8b0:4864:20::1035]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wXF2p-00000002IwX-2UQK for pgsql-hackers@lists.postgresql.org; Wed, 10 Jun 2026 09:16:21 +0000 Received: by mail-pj1-x1035.google.com with SMTP id 98e67ed59e1d1-36d98c9b596so4101911a91.3 for ; Wed, 10 Jun 2026 02:16:18 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1781082977; x=1781687777; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=LbjwU40C9Sg8qQARiTA2ullP/PUxV4C6PT1iVmysNWI=; b=Sy4GI+cTmRR1GRWVrGkgyFs6H7r6+ATARaEbvQhbkfqkDBSjLa5LR9ahpeYUTcoVTX Lqtvgaq2tiSqXb/K09lEE+Bv16CDxfP56l49HHtq8XL7qPujeFYnINU3s9of6hnbaVmu lsXKLx6wqFJmOOgcjosInkvBOQjkvJpme/9B1Xd3cV6nbVortXQBJ1l7wt9twtCeWmkG txrf2JGegf+M03vVNkQCXJm9xhPvzwvIs/Ukhpfu14qZIHjWpTEbQf1RHKjNM9RKlKhi yvcA1mXrdP1gF8p1+OS285XgDhTZz3EDf7PoQbmDw+dLdmPj+vFU299yCnvJXSwYA1CV aihQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781082977; x=1781687777; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:x-gm-gg:x-gm-message-state :from:to:cc:subject:date:message-id:reply-to; bh=LbjwU40C9Sg8qQARiTA2ullP/PUxV4C6PT1iVmysNWI=; b=hSAahgGA7NyPuZcpFZXbwiPb8PSJ3QOK5Ss2CCObbiY8J8DTuOHTOYfjtBsk4s62ji FdxyESeZ1/8cKc5Owvn2aDUnw15IDvH4S/UVx1AU97/VPxpCbgrSYeC2VVxDHLZg795d +NeVk/mqxetiD3cT6ZChnTZAX1G8vVhFuF4E5TOc3PcdYkOoMUgsuUVcgwVgBC56XdhM Sbn7q6rP+jCE0cbS5JcwVB7zTiT2SeqvVmYpBxTWo2Y3o+Z6NewCeVscwDBd3QRrG56g SxsmWlKdTudy9PrPCCMpe6rwuCCjKYQGLZb7siyqZS7ihqtVFv60RRV4mjjO7Q1dMfGM qheA== X-Forwarded-Encrypted: i=1; AFNElJ/1gBY+PrhEKyYKfowJrQTYKu52hbFhkwn+WCzaYhwNDpmxCdnfglY0AP7PDXeP6no9AT9CqFZ7uGjTPoaW@lists.postgresql.org X-Gm-Message-State: AOJu0YwKhdNpDSKWffik4lznraciENuOjyz92pXe6/oiruR2U7KcyFsz 3M/YU22ICEG66I5dhqLM6N0hRg0RtANiyTXsdjxtd2BSvdpS+PxM/skg X-Gm-Gg: Acq92OG7st1YALVdUvb7mlvRraTbZDFED2L0BOxkQo+JgHkCpg/VcyQMWULBPIAvU6W X+4czXt7wVcoxIy0AFRf7z/FUkmy10x+mFbRjd+WoMJG/YewV/kSxKkNsRFmXc/0pHaGmHuSyBF TKaiPtTZd5PTQOZMGu5ylQ2s/u97zHLXc++dxowodKEE1fBTTZUehCv9FzRSVjc0A8WNTn4ByID qr/NQgh0urQ2yu+MGaqpbgLjSvVNlDbU7izSem+4aj6ChdE+uWVxoyIMDnU4u8mkEfU9DPR3mJJ zceOQxyb1gNWB3F259m12StFVJwgAv/TAPKQSP6dDMlGbR9h0NYwvArwb/WlB+dqdIA/gaSxd4z Nq6yScl84bi3mpiwxebAHFlr3tE8VQSbrisw9FVXQw6PqL93manOu4meGyxj5nwS38JCkmNM2bh umi6y/IhRKvf6xXCcYnvNgxBy5CLhxEp7oED2Vwfo7rnY= X-Received: by 2002:a17:90b:548e:b0:369:e4d4:79c6 with SMTP id 98e67ed59e1d1-370f0b55fbemr24203776a91.20.1781082976931; Wed, 10 Jun 2026 02:16:16 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.161]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-3762175af43sm2203713a91.5.2026.06.10.02.16.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jun 2026 02:16:16 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.600.51.1.1\)) Subject: Re: [PATCH] Rebuild CHECK constraints after generated column SET EXPRESSION From: Chao Li In-Reply-To: Date: Wed, 10 Jun 2026 17:15:38 +0800 Cc: Zsolt Parragi , pgsql-hackers@lists.postgresql.org, Peter Eisentraut Content-Transfer-Encoding: quoted-printable Message-Id: <4B8C04AD-B4F1-43E3-8BC3-7A8800F3498B@gmail.com> References: To: jian he , Ayush Tiwari X-Mailer: Apple Mail (2.3864.600.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Jun 2, 2026, at 08:41, jian he wrote: >=20 > On Fri, May 29, 2026 at 6:58=E2=80=AFAM Zsolt Parragi = wrote: >>=20 >> Looks good, I have one nitpick question: >>=20 >> + if (isnull) >> + elog(WARNING, "null conbin for = relation \"%s\"", >> + = RelationGetRelationName(rel)); >>=20 >> Shouldn't this be an error instead? Most existing checks treat it as >> an error, and that seems better to me as this shouldn't happen >> normally? >>=20 > OK. >=20 > I changed it to: >> + if (isnull) >> + elog(ERROR, "null conbin for relation = \"%s\"", >> + = RelationGetRelationName(rel)); >=20 > I also slightly rephrased the commit message. >=20 >=20 >=20 > -- > jian > https://www.enterprisedb.com/ Sorry for not noticing this thread earlier. I also found the same = problem while testing the feature and posted a patch in [1]. Thanks to = Jian for pointing out this thread. After reading v6 from this thread, I think my implementation is slightly = different: * v6 adds a new helper, RememberWholeRowDependentForRebuilding(), which = reads pg_constraint and pg_index to find objects to rebuild. * My implementation in [1] reuses RememberAllDependentForRebuilding(), = which reads pg_depend, because whole-row dependencies have refobjsubid =3D= 0. My v1 missed the partial-index case, so I added a new helper in v2 = to read pg_index. The main difference is that my patch reuses the existing = dependency-based rebuild machinery where possible, and only scans = pg_index directly for the partial-index case where pg_depend does not = record the whole-row Var dependency. It is also smaller: this thread=E2=80= =99s v6 adds 185 lines to tablecmds.c, while my v2 adds 123 lines. Would you mind taking a look at my implementation in [1]? BTW, I have also added this problem to the open items list, as I think = it should be fixed before releasing v19. [1] = https://www.postgresql.org/message-id/71242FEA-15A3-4073-9FA1-561CA744ACBD= %40gmail.com Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/