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 1x4Z2k-007FVv-2J for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 07:17:58 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4Z2j-002vXz-2H for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 07:17:57 +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 1x4Z2j-002vXq-1L for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 07:17:57 +0000 Received: from mail-pf1-x42f.google.com ([2607:f8b0:4864:20::42f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4Z2g-00000003ueF-3pV9 for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 07:17:57 +0000 Received: by mail-pf1-x42f.google.com with SMTP id d2e1a72fcca58-855d2bfae95so241696b3a.1 for ; Thu, 10 Sep 2026 00:17:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789024672; x=1789629472; darn=lists.postgresql.org; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:from:to:cc :subject:date:message-id:reply-to:content-type; bh=1bB1aNzP6zGkg2DcvWYAVHZ/t/Qil6EscsKN73S7VsY=; b=TMqT5HYBfe0xbQQTb4mSa8/P+N3eGovoZYuMeVzBHvVFSZcZ0MpqSU619nkSoxG5K/ NKcl/3Sx5Yab5GLi1TtaHM8HVC9b7sbxuQ0LG4cZ27JNqeOiX2Lc88JeKyaettpTtlKn NVak/c5lgSYr/lnUofT3J5jVdPOJgwpG4IfwMnagXmnKhRJM1vrfO11nIOtptv5Cf68y oFtLZqIRs5walNTR1VR1D7o5fK7LjStjTAsfN5zlKQX4bDmv0kYrMUdo3HhD0bFjYbJ7 nrZ7R4A1E0FQ0VJAqSFHbCcSR3H4eGJCMNv465b9SB/fDIc4VhI448ENqcMJFYIawOo3 gAxg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789024672; x=1789629472; h=to:references:message-id:content-transfer-encoding:cc:date :in-reply-to:from:subject:mime-version:content-type:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=1bB1aNzP6zGkg2DcvWYAVHZ/t/Qil6EscsKN73S7VsY=; b=DES9HqxAqF/a3JSvn9h00s503mZ7azSq0Ps5yoGxvFS+Pn26J9Hk+WaeQmhA+sSWAW 9XtMEzBWwxrxuWXW1k7lr1fGtT+sDp/Uo/lLIzS4t/OCABdkhDchUB5vh9DIsFnaIUx+ Mm8umJNeI13cLRi7P8m/X2qld6xul7GHJnTPrfOY38UcRBVxyaiLn5S2pszo1FMf+xsi uLwJiWMlZhqhRtPZhiV6t4+q5iXoVwN2Y2AIb+Kr2kG3QPTY4YH+ofN5R2GgmA0nWoqV tuhCbOBygs0UHQPi2Bh6VXr3UX8zVzWzjYHdU0TQ+YPmnbeYaAFOszHijaX4ZaxXMb5B IhDg== X-Gm-Message-State: AFuF++lo1Wi63rpAA/Qq3FL9UktMKuUx7ygRO9ctyhSB2+T4Olm5gCta m2j9xEHyvZRjY9cO3jHWVzmH5tQjrWqxQ2iPmDrzk7BsvO/nRxZpOH7jfiG1QQ== X-Gm-Gg: AYBFou3Jb4vublqyQ6VpQUKZeHcczFCELVlD+8mWxz6GsHjuiS6BMHUNeYkMIW829DA do4ksvK6nfEkGX0uiYsA8EzVvt74iV+CLUtwQsIHhuETVQS7zYuoYmEz555Go3f0LiPhsEMURJj 3LXpFdVncnQAKS42KtP8CtAaawoU2JcmdtOtZd5pnDgJViQqQVhGkAvY0uaFuKYw6eeMl9IVqRT OPK/qdRVvGwf3XYDN5XBWmGjQKav1yTpImXqggF9Ceg7/4dxV7C7kAucdPXKzbEEbhaDhSNpJzj 0ewzEEvtBAe44dA5Rjs4mK2KW9jS5d+4WFBlNCsfcfFy4QFin40AmcMO0lZE9FIjUBHp2V3XnI3 yHYDEJ7XzqDUX79wy00dg0rJDySZVx/MFl3EOWFJcOmdEpY+1qGZgcB4gWIQDzTaRxZXuKAN7FG q2m/KYj+sN7LiN9xT95trPGg04+hFWi1LMOHlwdg2hUpPE6fXce78rEL/B7RJwIbM8gh0Q98QwS qtNo8+/F+39Vu/GU4Q= X-Received: by 2002:a05:6a00:c483:b0:86a:2678:d619 with SMTP id d2e1a72fcca58-86a2678d6f8mr768444b3a.13.1789024672237; Thu, 10 Sep 2026 00:17:52 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-86154048df2sm7760906b3a.61.2026.09.10.00.17.50 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2026 00:17:51 -0700 (PDT) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 16.0 \(3864.700.51.1.1\)) Subject: Re: Review items for EXCEPT TABLE publication From: Chao Li In-Reply-To: Date: Thu, 10 Sep 2026 15:17:17 +0800 Cc: PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: <3B3DA418-8D27-44D9-AEA6-8CC24EB33CEB@gmail.com> References: To: vignesh C X-Mailer: Apple Mail (2.3864.700.51.1.1) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk > On Sep 10, 2026, at 13:39, vignesh C wrote: >=20 > Finding #2: ALTER PUBLICATION validates against pre-lock state >=20 > CheckAlterPublication() validates that pg_publication_rel entries are > either all inclusions or all exclusions. However, this check is > performed before LockDatabaseObject(). A concurrent ALTER PUBLICATION > can therefore add an inclusion while another session is validating and > waiting for the lock. The second command then proceeds without > revalidating after the lock is acquired, leaving the publication with > a mixture of inclusion and exclusion entries. >=20 > Test to reproduce: > -- session 1: -- session 2: > CREATE PUBLICATION p; > BEGIN; > ALTER PUBLICATION p > ADD TABLE t2; > ALTER PUBLICATION p > SET ALL TABLES EXCEPT = (TABLE t1); > -- passes = CheckAlterPublication() > -- while s1's row is = invisible, > -- then blocks on the lock > COMMIT; -- resumes without re-checking >=20 > The fix is to perform CheckAlterPublication() after acquiring the > publication lock, so that validation is performed against the current > publication state. >=20 >=20 > Regards, > Vignesh > = v1-0002 looks correct and appears to fix the race described in finding = 2. Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/