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 1wFUIB-005BlC-2P for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 09:54:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wFUIA-00CsQ5-1b for pgsql-hackers@arkaria.postgresql.org; Wed, 22 Apr 2026 09:54:46 +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 1wFUIA-00CsPx-0X for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 09:54:46 +0000 Received: from mail-pj1-x102e.google.com ([2607:f8b0:4864:20::102e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wFUI8-00000002S31-0mjQ for pgsql-hackers@lists.postgresql.org; Wed, 22 Apr 2026 09:54:45 +0000 Received: by mail-pj1-x102e.google.com with SMTP id 98e67ed59e1d1-35da2d35eccso3708302a91.0 for ; Wed, 22 Apr 2026 02:54:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1776851681; cv=none; d=google.com; s=arc-20240605; b=kzl3z/d3LBwsxTx07V2l/6RCJCEoBqEeDS/eJr8xVDGrQM/8E7T/+BUDo4QqmmsBrE qO7eaWP4pum+0EEa7CNqyaoz2AL/fVLotIQbaxvCDKxkxJ/50HyNepmy+Tj4I7UQJtef 7sk5cJpcCM5Hw4GtS2E4mand9maXCTUDeCJRllIsHxbxBtLaD7j/SUUHw2K3H3JSs2pC 3iBiU+n65M9dIFGuKw6AxIYhvVgqn67RCrOH8X0nwJPoMSHKg1WQn5IicdchPPzeEzws TML/FY1mCdu2sCMfP37ee06WWU8DzG9o4Rxh6+X7TWXkHInbuXB9PfRXisHutZ9LY7iw PzjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=IyHqLVP7N5Fuy2xoWYhh/lkuc1PKVPnHbguonK3eBvM=; fh=cYhu/2PykLeYpiIUiTXI8fKlgZQQUR5+KTdbnjXQts4=; b=CzkadaI9t1SoY7NadnxHg4pga0WARazA7sGBVKRVtZiRwWbwHvgcf3n/+BwjGrli3Q JBpRXjECnTwESaBtJsGumCRi3DiVt7vJSQAxNIWZz+AUvZQkpMqnUMtUKnIRf0nfV69W ZHC6aZMM7X7NNhFh8ZIm1yfErWtBYJMG6l5yJuJ4Hz4/fvu+oyuv7Apnnl65blh1FFEX R4A4kr2z5/KTlrzxg3iBD/Ky2qBIUHwf0vh3sWyz7vfGDjnG9wsdKXEYxZbi1THGRSml bEpITq6BjYxgVr6obSvSwyBSi2LelHMgjKZ/b9bF8byNGI+/EiWU99ACXMcP5ziFSG+i 2bmg==; darn=lists.postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1776851681; x=1777456481; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=IyHqLVP7N5Fuy2xoWYhh/lkuc1PKVPnHbguonK3eBvM=; b=nQR5nhaqhizrUNBwjOKQ+K0ViNEVClx1i+MLypsWfdPj97woV8uSCA+296prAd0Q4j BGAkYjgxPjHwucPna77qUp/CyqUAupnV4aBXuXjd+UNCGT8wpO5kAMNRCPyTt1IECkG+ Lm7ARbv5Z2TQy8CIDLH6scXpNhrV/lPdH3fyedD0DZGEHG//KAbuFlx25CNbvV7aj13G 27mb81hGGycVee5aF3XK1068WZNxmSrCuN0f6fqfPqsqMqHz1IavN9oUpREMCNiGw9f/ 21tGHdJusJmlzesVw9N82QYQw3zokT26ogCmDxTdQ8ebciLHeSFxl3tzU4rHVl6tVLxe L0QQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1776851681; x=1777456481; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=IyHqLVP7N5Fuy2xoWYhh/lkuc1PKVPnHbguonK3eBvM=; b=O7yt1s/9fgyUaYZH+tT14CiF4MW77MF3nSVxepooHAaneF+CQU+je9cuObtFCbGTRa 5Kk6N2oKvLMmUim3G9dsLq86qqsqb9PLw/MPhCOiR2SvDl/aFseugbGQr2O3fu3XrKuq yAJyqyyfExMw309Ck0RGQ9P0zZtRu7r+Gz5p/DvYx7llfYHa10B/uqh1gAwcKHBcvcCu xJvn0KzXu3lXxi9y4IBkKehqMm8taiP2yL1/JVY8Zo007Xrl2ip4mVBsF9ZUPePoi3nV L2wtrmd2UsKUbQd/LU4JcYzKXk9YNWUDWDhD2Va4oYY7A3ukeOVS5FrrsxLb2Iky3zFy AsgA== X-Forwarded-Encrypted: i=1; AFNElJ+cIUJHUB2W9TV6wotXgtgLirNeDnK3Ult1TfAFxEZHq529+lgCvQASSxM1ylqKuP/jU7Ik7ehUEVcxnlzM@lists.postgresql.org X-Gm-Message-State: AOJu0YxBIeuJKPNGBrEHlRJdRPkPobC1FmN+OBuxcx8mVKTFyehR+aCa PCz+rF4NtTlVjDWQP4mzg/ETuuyvvtKxRSgcYOH20G5dpFSeuKwcmWEvRbSaoMtkT2/NofnKB4o 6PkwBh/C33yaRfKV14SMuXf0FWBbwlI0= X-Gm-Gg: AeBDieunShFWS567LjMcciS/M7HmB7Ny/AK3Ygq2OzRknWpeg6HM7MYYmBR7E2QIC4Q skNUulpf8Fy3nssVTEBUzM5kTkqm+5ji5vukwd75ti1/Bhhd+bEAUSZ4mKs3Ib+11eve00Rhizi MW/wrb45Qb3YY6Y0xSfDkD3hFV9YaPj4+JWmO78D7QNMkdT81Hmn+RScVkyDyhH+mZhgPWSKrJj GYh0zBih1BbhQ65e5Sbk0fTw2X6YppbgiJUfc1MTxxEoBF6ykJ7bXgU9dblr7MW+ctDlc8tYNFb gUhxRMvp6s4WPlbwI7muosgEK5GkyxPzOxkoX51L9topb5NA0tXGBNYJlw03pze2J8GHVZHKWA= = X-Received: by 2002:a17:90b:4cc5:b0:35d:a3b4:2f0d with SMTP id 98e67ed59e1d1-361403ca654mr21824208a91.6.1776851681539; Wed, 22 Apr 2026 02:54:41 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Wed, 22 Apr 2026 15:24:28 +0530 X-Gm-Features: AQROBzAclEPMrCumMBQWF5sETkDCoZR8aUazfmrdav3XZ69d1qDI7gz9PU8TlyQ Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: Peter Smith , Amit Kapila , Shlok Kyal , Dilip Kumar , Masahiko Sawada , "Hayato Kuroda (Fujitsu)" , Nisha Moond , Ashutosh Sharma , "David G. Johnston" , "Zhijie Hou (Fujitsu)" , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers , shveta malik Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Apr 20, 2026 at 5:43=E2=80=AFPM vignesh C wro= te: > > Hi, > > When changing a table to UNLOGGED, tables that appear in publications > via EXCEPT clauses (prexcept =3D true) are currently allowed, but their > entries remain in pg_publication_rel. > > For example: > postgres=3D# create table t1(c1 int); > CREATE TABLE > postgres=3D# create publication pub1 for all tables except (table t1); > CREATE PUBLICATION > postgres=3D# alter table t1 set unlogged; > ALTER TABLE > postgres=3D# \d t1 > Unlogged table "public.t1" > Column | Type | Collation | Nullable | Default > --------+---------+-----------+----------+--------- > c1 | integer | | | > Except publications: > "pub1" > > Since UNLOGGED tables are not supported in publications, this leaves > stale catalog entries. This patch removes such entries from > pg_publication_rel when the table is changed to UNLOGGED, and emits a > NOTICE to inform the user. > > Another option considered was to throw an error when setting such > tables to UNLOGGED. However, allowing the operation was preferred, > since UNLOGGED tables do not generate WAL and are not replicated > anyway, so blocking the operation would be unnecessarily restrictive. > > Attached patch has the changes for the same. > The main concern of removal table form EXCEPT-list is that once the table is changed back to LOGGED, there is no internal way to add it to the EXCEPT list again. OTOH, raising an ERROR does not seem like a good solution either. When a user converts a table to UNLOGGED, they are effectively excluding it from publications. Therefore, throwing an error for the purpose that "table is part of EXCEPT, cannot convert it to UNLOGGED" does not appear appropriate, since both actions ultimately exclude the table from publication. I think we can keep the current behavior unchanged as it causes no harm. Alternatively, if we want to remove the table from the EXCEPT list: 1) may be a WARNING is better? 2) the error message can be improved; the current one ([1]) seems uninforma= tive. 3) And we can also add DETAIL saying add it to EXCEPT list manually if needed later(something on this line). Thoughts? [1]: + ereport(NOTICE, + errmsg("relation \"%s\" removed from publication \"%s\" due to being changed to UNLOGGED", + RelationGetRelationName(rel), pubname)); thanks Shveta