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 1wZP5T-0010io-2n for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 08:24:00 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1wZP5Q-00GA4T-12 for pgsql-hackers@arkaria.postgresql.org; Tue, 16 Jun 2026 08:23:56 +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 1wZP5P-00GA4D-2k for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 08:23:56 +0000 Received: from mail-qt1-x829.google.com ([2607:f8b0:4864:20::829]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1wZP5O-00000000c6J-2Ex4 for pgsql-hackers@lists.postgresql.org; Tue, 16 Jun 2026 08:23:54 +0000 Received: by mail-qt1-x829.google.com with SMTP id d75a77b69052e-5176465a4a4so62879641cf.2 for ; Tue, 16 Jun 2026 01:23:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1781598233; cv=none; d=google.com; s=arc-20240605; b=B4SRec6/jnBWl60tinNhZBoUnY4K2mWufO7YOh26ukFzQzDI3QJQRYrJkf0ohhHvnl ZytqbZ9m9x+h1FLZ/sHQmAWc1hTha1jKRYA18s8yCSDLZ6la6lpQlluDiEMw5z+/I7gx C7LR63JV26ia4ateoV5KcPtyePHF/I+ATtI04hsQ2erwK4zVMfq64GFDEm95EecDaEt6 4Hia1NZpQVNj8v09k5Y5Gei5tK5sAolK96KpvU6kzSa5c3rgzg44s6eMaloGd+ZKV3M+ ZNbNZ7FclK9qKpCCGXyeav8bhumVugA9zO/TF7dt3LwHnR7KNdjYt4kJMKJRvZAurI7M lQng== 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=V7qs7JAGbuKTP4bBT3QXbxOdb7ANzxJ51qBa+pYGgpI=; fh=wK/3Tn6V/i3XzSdCQyvaO2sT0bdVcE/rVFnTAt4Hp+o=; b=IgskKnHH4HnWt5vXD89C9uEqY+2Mwi9wF5ThmEoxM4gTOOMBM1csOb5huqzGTM8RqN Dnfrox1WOiYgVbIGOaH2cstOP3QUuuZZ1N6HmAfliE+W9zPN/MYp7fDFJnNOfKJWxWLL BNbZS89UI2KizfyuLJKFDiuKG2Qyrmf4wawMNXJmUEWxpx80SiOpelZ03PNqBw4ckFjO B/jscPfdyvovRu5OSba1s49+WvxTNNCzQW2KgCmoMVV5fS7nlRzNAnqYaEsLmm7FwREc 3oM2E1z/5SN94ifLOmn/2zVESApJp6Bo7zKBMWPsJGpLiK7crQ/OxEqlXM8O1OyBmncM MS8Q==; 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=1781598233; x=1782203033; 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=V7qs7JAGbuKTP4bBT3QXbxOdb7ANzxJ51qBa+pYGgpI=; b=hylW0JuGYem1hoyRoUwQjbRJulVV5o2149xVk9G92fE8QNilxed1MegRHKLrWw8c1Q +s52NCHQJSJRPwhz1tDWS46oXQVB9hEZJxpeO9hMRaB0YIhOxWhvj67UxuJGyazM4PNp kHjF+Wq4JPR/SjQ2+fxmc8YLboy+dHMLP4JPF3uKSdpKO8zrDWMuNYcWU7lmqyd1Tap8 pEPc/kXFudCRetEjsJ9Fr+AglivR1OdZBZAIYDiztSSAyu0Lm+oMBSmFlAiE0NJnpz4H kpTQN6+QAGcRwJljy86ZtwFGOoii3Rx9Gn2SakaPQcW533+nZERWhXs+/oOUnJR57XP7 ehAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1781598233; x=1782203033; 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=V7qs7JAGbuKTP4bBT3QXbxOdb7ANzxJ51qBa+pYGgpI=; b=AkzxLopv/jssWZEsR8JnL8hHw9c0EnJZhceMU8wACZ0coNZX3EOCOHSU754UnkvB6u PkU1e6mQCaVuYtF8mtNzH8ZOht3X89aWSKsxX6np6rJy8/gcqwjecgmXvR9+nF8xzQF6 EGtDHlfoWSayqKiFursIyMa4poVVsr/WJBwgyOR2G+50OTF5s37PGXPd+eyHI/K8wtQ5 C3t1XEBlh8Sn7Fn4+PCSFcj4K1YooV5vpPrR5quzwO4v+QsHgTs9icwP04+p0Vk6j12e tXFolBNXkUomPNJ9sAH6VgixQVW6fcrmazpvzihpRIG8jrkweUtCRJICW+b15MdAnBJ5 TIGQ== X-Forwarded-Encrypted: i=1; AFNElJ8ar34fWTYb0nE4f5byjKcBwQ5d+yxeyvIb5wfIf0kKyRy04I3bgj341tmGpK+EKKOes7XR3ZvNnHn/2lKa@lists.postgresql.org X-Gm-Message-State: AOJu0Yzp3OSqfXMeVQVcUVQQWMTc95CoP5CWhaeIEk22VSUgPEaCnINm j/uS7lsxjNvH25vGZxgqMHo5TbbBQNLnWITvGRy8hhZYwAPyubKiwvS3ADxOH8meG/fQYZ9QMLZ BVv8SKmPbvcQc0P+0Ah702MZ9zisGrXc= X-Gm-Gg: Acq92OFcePy45d6mRlXGzXa0q3T8ZO63F0iqFywdqlqLoc/qN4Qmg2ugcFd80ZYB0bg klTMKtZsLdYHk6RKYVb+wIGGuMXPjDne5aVANvWLCkmkZJfYwaLMOe4DRfVfbcbQTwv3YLVLUW8 3cGpQ28NtUS0TV53Ub+eGc/XS4EDiH05X9qXmAQUN4ZV2Quw+n66e0EOf7x2njr+STOpb5zk49U bTZNwzT9X/sj8a3XY5AG2I3nn+LSaIM0iMLMe7l7oypZLVtDx02CU8EGhNI6sK86c8h3Z2AvKmS rkJun00= X-Received: by 2002:ac8:5d91:0:b0:50f:b494:7887 with SMTP id d75a77b69052e-519535708e1mr211671471cf.51.1781598233440; Tue, 16 Jun 2026 01:23:53 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Tue, 16 Jun 2026 18:23:25 +1000 X-Gm-Features: AVVi8Cf8k5O20If3tRhLUKqvq5UKHMWvv8xXx9GxZKADdcOZTVAYjnqBC0qmvdw Message-ID: Subject: Re: Support EXCEPT for TABLES IN SCHEMA publications To: Nisha Moond Cc: Amit Kapila , Zsolt Parragi , pgsql-hackers@lists.postgresql.org Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Some review comments for v13-0001. ====== doc/src/sgml/ref/create_publication.sgml 1. Marks the publication as one that replicates changes for all tables in the specified list of schemas, including tables created in the future. + Tables listed in the EXCEPT clause for a given schema + are excluded from the publication. Given Amit's suggestion [1] to modify the EXCEPT text for FOR ALL TABLES, perhaps there also needs to be an equivalent note for ALL TABLES IN SCHEMA. Maybe wait to see what happens [1], then you can use similar wording. ====== src/backend/commands/publicationcmds.c RemovePublicationExceptForRelation: 2. +/* + * Remove any EXCEPT clause entries for a relation from schema publications. + * Called when a table changes schema (ALTER TABLE ... SET SCHEMA), so that + * a schema-scoped exclusion does not silently follow the table to its new + * schema. + */ +void +RemovePublicationExceptForRelation(Oid relid, Oid oldNspOid, Oid newNspOid) +{ There's nothing about that function name to indicate it is only for SCHEMA publications. There must be a better -- e.g. 'MaybeRemoveExclusionFromSchemaPub', or whatever... ~~~ 3. + ereport(DEBUG2, + errmsg_internal("auto-drop exclusion of table %s from publication %s: table moved to schema %s", + quote_qualified_identifier(get_namespace_name(oldNspOid), + get_rel_name(relid)), + get_publication_name(pubid, false), + quote_identifier(get_namespace_name(newNspOid)))); Even though this is a debugging message, for consistency, we might as well quote everything the same as normal messages do: "auto-drop exclusion of table \"%s\" from publication \"%s\": table moved to schema \"%s\"" ====== [1] https://www.postgresql.org/message-id/CAA4eK1J_QP8CXCshaCy_01ALQQrDSzoTHfXKcAbjiEvV-RkOOw%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia