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 1wRmVb-002gz6-12 for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 07:47:27 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wRmVZ-003l9u-0s for pgsql-hackers@arkaria.postgresql.org; Tue, 26 May 2026 07:47:26 +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.96) (envelope-from ) id 1wRmVY-003l9m-3C for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 07:47:25 +0000 Received: from mail-dy1-x132d.google.com ([2607:f8b0:4864:20::132d]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wRmVX-00000000p14-1DDo for pgsql-hackers@lists.postgresql.org; Tue, 26 May 2026 07:47:24 +0000 Received: by mail-dy1-x132d.google.com with SMTP id 5a478bee46e88-304997cdb21so1518848eec.0 for ; Tue, 26 May 2026 00:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1779781642; x=1780386442; 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=YcVRoDcr1S8JeMOhIV9fdP1riTW2OJs47H4Cyr28ZtI=; b=e1NQE7oY2yUf9AC69SLJnpdShrqWlFeck5aikAeFzPiH3z3Re9ESlk+qpVr8AuXOM9 4YLQziVnXZ1KARMp6pE9m4Bz7qTSjiFsOyG72sL5HEFDil81vOsaWA5Dqb0SMU2t2r+O IRGcXe3aJ6ca+jZ9qj369P5GITJoSWDwZjfQFHJFjhEOHpTsqAJ7OxyCj+vDEJyfUN5I MRNi8VfInKBK8jCY8Zr28ajgmQ6krHxUUG1/W6C9k8+6qDbSIuI46DqofDVYfeEwV/o3 MK2R6Fg3Qq43OT/Yu1ovlHfSXukLgI8C6Oha0j9G4XtkYRIZxrxeejRTMD/vs4QZU9Nc dBlg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1779781642; x=1780386442; 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=YcVRoDcr1S8JeMOhIV9fdP1riTW2OJs47H4Cyr28ZtI=; b=mJnMatkuBJD1Pg6lnssEcIH5w8kvJ+sZpGuyAIkOs8TZ07vg63IV5/bwsOp6a0erlC I4eHXUyNImqX4dxdWi31ONZx4FE/wHDb01rMufNJx9GgOBANbGmcEWx0lx2qnbc3rJZW z+m53ZZ/vWI5yTPSOp+6NXLr5mnh8O/l0UucGCU5Z18l2R0g3cIakkZ9eTSLgYKv5Pys yqQ0Btxj/gBu1EWJjbnrWDeLrlxKgNYH3zxqjkgpyGzm5+w+vAIpYaKJ1sSAtLSbvidY 9dLWOKM5pOJEKhkAgTt+TbBGrE4qUAtlaIapupSxi+vXBYnyfVwwiuuCtt6pv2cUcAcv d3qg== X-Forwarded-Encrypted: i=1; AFNElJ9O/m4zGDQXZXZHqRVkeoR7GO6Jki9VxF+bMbI/vzZN5t3tgJLPvw1DhaHFQ4isywEe8FBw5XoBPWF/TsOT@lists.postgresql.org X-Gm-Message-State: AOJu0YyofzFkwPYc+fRM07NRNwx3dAFqgvQoRa4mSJp42jqIzlvIRItf 2+sunqBO8MDMQVUpHWj+3mOC+o1Ejl5T5I8XDlvbH+WLhD0EP3mmOZet X-Gm-Gg: Acq92OEegY2yQw0elYcp4kNi7PKGglpDqSkPAFIiKVd5p3e2ib+Yy3AiFokcnkGq9hJ Ot0T/P07Vk1OCSvRPnfpwAT0XhGJXIvE7E1BAECokR0YtsuMh9NVnZEdjha98I+GOwnxe9h9ou/ LzHWdXwIWu1VzA7sNHnh9edRab98PQcWJ4AC1gRgzojH9eKlpeZLXolafmiDK/2Wg8aaoozT0jv sAMIw2un6t9Kta6f7FDUCy2mxdOPG4yZ1AQAqEohPK0aWYDCBuHkIMcmiBOztJMdSxl44j/xQDD Goh+y68NG43I7Yja4nN8asj+CpmkCdv0oICEDZgatVwQEhK8UpBz2zAEVVdEE08KzqwVcNk9WuH OE+2gPSYA8eA4ny07pv5Bg7f3CvwrC3NkgVn3L29tWDf35+ws6petWRq/CBM9EKrrQWmc2arSyH 3aX5LLnRhXMVkAZtDy407hbSzbLKZgfw== X-Received: by 2002:a05:7300:6da0:b0:2ed:e12:376b with SMTP id 5a478bee46e88-3044925fe81mr6879016eec.33.1779781642347; Tue, 26 May 2026 00:47:22 -0700 (PDT) Received: from smtpclient.apple ([64.32.14.230]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-30452255234sm12284477eec.20.2026.05.26.00.47.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 26 May 2026 00:47:21 -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: Fix bug of CHECK constraint enforceability recursion From: Chao Li In-Reply-To: Date: Tue, 26 May 2026 15:46:46 +0800 Cc: jian he , "L. pgsql-hackers" , Andrew Dunstan Content-Transfer-Encoding: quoted-printable Message-Id: <33E9C4C2-B6A8-4FCC-BEEA-461EA5FB98C8@gmail.com> References: To: =?utf-8?Q?=C3=81lvaro_Herrera?= 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 May 26, 2026, at 15:32, =C3=81lvaro Herrera = wrote: >=20 > On 2026-05-26, Chao Li wrote: >>> On May 26, 2026, at 14:05, jian he = wrote: >=20 >>> Overall, i tend to think that we should reject ALTER TABLE ALTER >>> CONSTRAINT if it >>> would result in the parent constraint being enforced while the child = constraint >>> is not enforced. >=20 > Yeah. >=20 >> I am not against the idea of "rejecting ALTER TABLE ALTER CONSTRAINT = if=20 >> it would result in the parent constraint being enforced while the = child=20 >> constrain is not enforced", but I=E2=80=99m afraid it=E2=80=99s too = late for PG19. So,=20 >> I guess we still need to fix the issue for 19, right? >=20 > I think this is a bug that we need to fix in 19 as well =E2=80=94 I = mean we should reject the ALTER TABLE. >=20 > --=20 > =C3=81lvaro Herrera Thanks for your comment. Let me rework the patch. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/