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 1x4Zc5-007FoJ-0u for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 07:54:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4Zc4-003Bex-0l for pgsql-hackers@arkaria.postgresql.org; Thu, 10 Sep 2026 07:54:28 +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 1x4Zc3-003Bem-2t for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 07:54:27 +0000 Received: from mail-pl1-x62d.google.com ([2607:f8b0:4864:20::62d]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4Zc1-00000003uva-1L85 for pgsql-hackers@lists.postgresql.org; Thu, 10 Sep 2026 07:54:27 +0000 Received: by mail-pl1-x62d.google.com with SMTP id d9443c01a7336-2db710396ffso5648665ad.1 for ; Thu, 10 Sep 2026 00:54:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789026862; x=1789631662; 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=T31mp7Ahs7e9QWDPOIDQruvz0oKGzD10IYDMqhUjki8=; b=hxDQxMpNkRRxWQ0otHgJkVwYy+dFDg0WikomlVRu1QxO5vXtrnRqWbHOD9jlEk85FX XOPYb4xNeBbHdhQ4QsDMfXxI25RFj+weu3EQIVXXgGG3mkoLioBLU3JS4JKGQ4UJZkDo XnbMH73iApintctHhvqJaKzqKfszQOngsXFNzyffUr3bj55jNM2VE/JJHBpetmBNZesN awoYjXDZiGsgAoT4XmTmLjj6yXA1c6e59T3heDcB+fXJcvgsqs3/JDyJhfGYXk5a5K0A qHdaDRiQe9J1tieP6NaplAlCA5x9BtMKhAolLXIjqFd/NPiKE7ZYSKWXa4jDoUESuj6V Y8wQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789026862; x=1789631662; 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=T31mp7Ahs7e9QWDPOIDQruvz0oKGzD10IYDMqhUjki8=; b=DFcuGXiTRU/jKcTj1kMC7ujDef93khi3yFzi/JwsIHbsV3VeAyGEGytbbc8KE5fMfP Hwx6XFA+mcJVRfNCkl0uBFpD5SWYm2yRCGhhaln8No6TTSV0M8mWGg35L/ZXkP9oA4jP CpSaSaRca62KBdEymvgWFxZ6x0X+zVnpPqqAf7AgVCZm1CW2/iVRX+3NEvkfUu9DLhcF 0inEYWqTVqzFQNSl9Jude82USZWtxAQfuAT/y6nNU6alhXDfnG6hQQ/n/zThiYb3OaOB 1kq5rpHGINAqQ5tFDoIYB7QyHrGW/2QdIY39mfeYYBq6Wi9/elRKyca6ccfFDasyMses lk7A== X-Gm-Message-State: AFuF++m4Gmr381Z2fgrCB2NrFlgnxG9KbgfsQCnUN9cIWFd8UufbByjQ cWcGg8ULbfulhgJy3z/lYJL5IwGJ+gewVDULIq2jHZsPKNzL92nBoztx X-Gm-Gg: AYBFou0BC5Oen+fJTzTShpl2Fot6lAAL7jK48LDQi7/BF/gMwtFHm0hdjl6SILB4xFX 3sf6neef8dx60xC8DQgIpC1gKRvTWzfpKyVmHK6xBS2wO119B36uVnDw+VLWU0vBNfvIdd82ROk GUNO5Ow7QUYSjkBMSbvJt19eI4i1EqvKF4vOEM4yE4L0EqWvE0tdnfcxy2oefjLC2any5raM4h6 +egvn7Bm++12Iacx6PE0cSSZTUGCCLVL6st4P5Z0L+7FeHJiPu4QLm1ehj1xJRmQUEzKbteGYXC rerfs2M1q1WuNqK3rL2jXUm61NnybjajY1WOYxjQw3j1wJIPdXXE+li6ZGSeW6oyTRftqxqFF6J xWZU9vhae+iWV/Gab2TNbE0q7ISmTOQs0v+iCW60E35iVqkwUAjy+8+fkHi4Sc1/F/6rQke+1Kb lHEwzg8YpXA/GsAYwyo3XQWl4W0Qo17svrg78ixSqOzIBDag1n8ts7R1nxwSoYVks5vxL+xuyxR euJPXg/ X-Received: by 2002:a17:90b:4ec7:b0:398:a649:8fa3 with SMTP id 98e67ed59e1d1-39d77b770ccmr4807236a91.23.1789026861791; Thu, 10 Sep 2026 00:54:21 -0700 (PDT) Received: from smtpclient.apple ([185.135.79.125]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-39d80f0068esm2701211a91.10.2026.09.10.00.54.19 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2026 00:54:21 -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:53:45 +0800 Cc: PostgreSQL Hackers Content-Transfer-Encoding: quoted-printable Message-Id: 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 #5: SET UNLOGGED on an excluded table produces an unrestorable > catalog state >=20 > CREATE PUBLICATION ... FOR ALL TABLES EXCEPT (...) correctly rejects > unlogged tables. However, ALTER TABLE ... SET UNLOGGED does not > perform the same check. Its publication check uses > GetRelationIncludedPublications(), which ignores pg_publication_rel > rows marked as prexcept. > As a result, the following currently succeeds: > CREATE TABLE t (a int); > CREATE PUBLICATION p FOR ALL TABLES EXCEPT (TABLE t); > ALTER TABLE t SET UNLOGGED; >=20 > This leaves an unlogged table in the publication's EXCEPT list, even > though an unlogged table cannot be added to an EXCEPT clause directly. > This causes failures when restoring a dump or running pg_upgrade. > For example, pg_dump produces: > CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT (TABLE ONLY public.t1) > WITH (publish =3D 'insert, update, delete, truncate'); > where t1 is an unlogged table. Restoring the dump fails with: > ERROR: cannot specify relation "public.t1" in the publication EXCEPT = clause > DETAIL: This operation is not supported for unlogged tables. >=20 > A similar error is seen during pg_upgrade: > ERROR: cannot specify relation "public.t1" in the publication EXCEPT = clause > DETAIL: This operation is not supported for unlogged tables. >=20 > The fix is to reject changing a table to UNLOGGED when it is > referenced in a publication's EXCEPT clause, similar to the existing > check for tables included in a publication. >=20 >=20 > Regards, > Vignesh > = For v1-0005, the code change itself looks good to me. However, I have some concern about the design. Since a table in the = EXCEPT list is not published anyway, do we really need to reject SET = UNLOGGED? Would it make more sense to remove the table from the EXCEPT = list and emit a NOTICE to inform the user? Best regards, -- Chao Li (Evan) HighGo Software Co., Ltd. https://www.highgo.com/