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 1wTx5R-000qpQ-3B for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jun 2026 07:29:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wTx5Q-009Og7-1X for pgsql-hackers@arkaria.postgresql.org; Mon, 01 Jun 2026 07:29:24 +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 1wTx5Q-009Ofz-0a for pgsql-hackers@lists.postgresql.org; Mon, 01 Jun 2026 07:29:24 +0000 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wTx5O-00000000XWH-0cmh for pgsql-hackers@lists.postgresql.org; Mon, 01 Jun 2026 07:29:23 +0000 Received: by mail-qt1-x82e.google.com with SMTP id d75a77b69052e-5174a1da4b2so10410781cf.2 for ; Mon, 01 Jun 2026 00:29:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1780298962; cv=none; d=google.com; s=arc-20240605; b=BFdowhpzSlTHlDYa7GsmY/18/slLQ6sHZL6kssHz/GXbMcef+c+G0AlSgx3saPhdiA lroSgU0NJd2Dx5X/qlndL9FkgSI2Z6iKVWtjTfvovyNX3dr58wxgpiukDIIqz6gOWRP6 VKTVnxdxQlFlK0ymNGqCTclCtHZTKIvUROWZRqHSMX1KlTJmCw2ZRhEDwc8k/OSQsPIN rZvWSU/MRj0qPOEkRuxI2+aS6MACeDMsyhyNB873o2DqScHRzOMOj/xp2x+QqwLi0mHk SdIB4C74m4YWUjWUHZFdzL1dqigr2md/oH9iPstsjFvsNEv6MNF3+Ew64JdmkggKQyFd c40g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=YMUOFRglCiFsFGDscjZqFmxyEIcUnJt5Xm4Y11ySNgE=; fh=hoCg12vhoDKwGd+Dyxk27O/glNn0Levruh+1CagmIw8=; b=MpahldLivRrqm5MAueFR2m0pwdt56tlTA5kGYig6H+7If/821SUqrefmcZZJzZP6gi /nv9TG2VDXpT+kw2TTeA0Lp06PR8SF326OuvbyXkEdG6yxyxs1zyPbbBkCmfD2/VrWtp D7Q+i0cZ6aWXWX+mVzFZ/ODuJHlng7Ujn7NHVPhsrlJm102RJDRRujs/c2YR02sMjpdj S2lwp17afUKsnfKBBYZQTtgdVhqQuNewHcudGG1qAQU7Vi4xujMpTYs1k5o42hjLZ5oq SDoIRmVcTS8tlkwmp2noF+X5GWbW+rTD2t/n4gZw54+emf9s6QsulEISOIwpTBKzoB8w pGbg==; 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=1780298962; x=1780903762; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=YMUOFRglCiFsFGDscjZqFmxyEIcUnJt5Xm4Y11ySNgE=; b=QeT3r/5YWLSXVXwek1PzBJrNK9ff90tzF7TJ1S6mu1LjySTwuBOE+PtAc3NQjTehKu LALmhZ2Q4+JiVhuFJXvC8Hl8+ZHgAfIeidFYFKgpjAYIiTni0WFMVPDlVwKbJYKBwXUK HPSgMemepp6c8IGswAjQDT+LsDo6ZEPfzIvcRHlqGQBkCR/HvxIP9G+qaYWF+99xAxPd QplkH/j1nTpWQV6g5IrDr7LtDp2MmY9tOeaSUMhGQ2PKPn+9Fm6odG3rlbipLiLzc2Eg WdYsNQLkrLERfq18lMO0EB6Ow+0fOUW3NyTSLhSVw3jjS/Dk8QX+yB7bZcuDVoCeq194 s71A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1780298962; x=1780903762; h=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=YMUOFRglCiFsFGDscjZqFmxyEIcUnJt5Xm4Y11ySNgE=; b=oMqCRMMvzavfpspKP/GOXiUimSHh3m00jBYHv0ylDmOLmcMeETkdgoYXcK4FR4yRCa nurxKUtrrfKIqt/y5sfSNfAk7+hOeW0nu+9FyiwI3/f+0w1NpmJbhqwGFjjZ1S1t5vHE CF25o8BnpWdRBXsz6D88mcSoAhImoLDmgt+1HVICmFSjNFAgFIlN7WhxTr0gQ5O46UPm GmKgJEU17TWQeM3MJVOwvXjSiMXyaW6aYBKvhymrKIbCfwV46SNh1bi7ofgJrwEbmEcn I5G4IM+twBzfTvStQBWvEN/19IjYTrq6bDQQzMTPyEdMe4r1gyGfyxFhsgt09+JwgJ7o /Q4A== X-Forwarded-Encrypted: i=1; AFNElJ/1wQoWWLdOKt/COMufme8yvKhCxNOg6GdX3Tnf4GisYcbH2JkqsSJp+wnHb96v9Vdtd/20sfbqlkHk6yXb@lists.postgresql.org X-Gm-Message-State: AOJu0YzDUSxYG3BeztOHVF37ojU6VbGThE3QO42K64ZAWzO8HncMGuFY zaNWzKDrwSSko70ar5yTOVzdG5veJ5rpi12y0aJbX7MPPt5tHhwAMlfsDKoAwhfSoG8lfus8iwF oGU2FE1U3jGmBUM+XSFBvSVQC94glQTdZHHPt X-Gm-Gg: Acq92OGcZWvbs71Z+UaybMUwQnD6hc5D7IFU+0BzCLPN49+YQXTt6VpJCEMT5T6nceB Pv3yEDWPI60Lx/k3751SRTzyHGU0jrSrBys6n4iSkg09ehOY0YrT2AmTG2DDhC3xi8U65QFbVgT jpQ6U9S2o3Rs70nxUl8OBju5cXT5a2V4Dd3UDPtWFO/Rmfi93Qlp+X4wEeYsym0+Y69/uaFkPAz AxmvSkzUHScdG6l3p0jjZMryLyveyc67WcPwjsWhNbROKCSR+9D1wKt0JgjaRIJS2WidArWoKMi 8yQeLrVSE4vC6VvperOdJFXb4/BC X-Received: by 2002:a05:622a:411a:b0:50d:9c60:fe2a with SMTP id d75a77b69052e-5173a61b9c8mr143855241cf.1.1780298960773; Mon, 01 Jun 2026 00:29:20 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Mon, 1 Jun 2026 17:28:53 +1000 X-Gm-Features: AVHnY4L0C3rIH7GBEwB4JDjwV4ZCk-W5LUyPjX0_zcdHAI2sVwqpbGKTt8w9az8 Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Nisha Moond Cc: shveta malik , Amit Kapila , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi Nisha. Some review comments for patch v8-0004. ====== src/backend/commands/publicationcmds.c AlterPublicationSchemaExceptTables: 1. + /* Collect OIDs of the desired new EXCEPT list. */ + foreach_ptr(PublicationRelInfo, pri, rels) + { + newexceptrelids = lappend_oid(newexceptrelids, + RelationGetRelid(pri->relation)); + } Block braces {} not needed. ~~~ 2. + if (!OidIsValid(proid)) + continue; /* already gone */ + + ObjectAddressSet(obj, PublicationRelRelationId, proid); + performDeletion(&obj, DROP_CASCADE, 0); SUGGESTION if (OidIsValid(proid)) { ObjectAddressSet(obj, PublicationRelRelationId, proid); performDeletion(&obj, DROP_CASCADE, 0); } ====== src/test/subscription/t/037_except.pl 3. I think you had used the SQL exactly as I previously suggested, but I made a mistake: It should say "SELECT count(*)" instead of "SELECT a". So it returns either 0 or 1 row. e.g. #1 $result = $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM sch1.tab_excluded WHERE a = 7"); is($result, qq(1), 'ALTER ... SET TABLES IN SCHEMA EXCEPT: newly included table is replicated' ); $result = $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM sch1.tab_published WHERE a = 7"); is($result, qq(0), 'ALTER ... SET TABLES IN SCHEMA EXCEPT: now-excluded table is not replicated' ); e.g. #2 $result = $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM sch1.tab_published WHERE a = 8"); is($result, qq(1), 'ALTER ... SET TABLES IN SCHEMA (no EXCEPT): tab_published replicated after except list cleared' ); $result = $node_subscriber->safe_psql('postgres', "SELECT count(*) FROM sch1.tab_excluded WHERE a = 8"); is($result, qq(1), 'ALTER ... SET TABLES IN SCHEMA (no EXCEPT): tab_excluded replicated after except list cleared' ); ====== Kind Regards, Peter Smith. Fujitsu Australia