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.94.2) (envelope-from ) id 1uWCAj-009mSl-SN for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2025 10:55:38 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1uWCAf-00GHbx-V8 for pgsql-hackers@arkaria.postgresql.org; Mon, 30 Jun 2025 10:55:34 +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.94.2) (envelope-from ) id 1uWCAf-00GHbp-Ie for pgsql-hackers@lists.postgresql.org; Mon, 30 Jun 2025 10:55:34 +0000 Received: from mail-pl1-x62a.google.com ([2607:f8b0:4864:20::62a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uWCAe-004tKp-0L for pgsql-hackers@lists.postgresql.org; Mon, 30 Jun 2025 10:55:33 +0000 Received: by mail-pl1-x62a.google.com with SMTP id d9443c01a7336-236377f00a1so40109865ad.3 for ; Mon, 30 Jun 2025 03:55:31 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1751280930; x=1751885730; 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=frvu7ZTIUINqXjF+nSUy9As7k0UmZ26XWADo78G3s9U=; b=UHDsdAxMiVnqW+2e01mOuwZnXLB49gBH4gmNQoEgj3Zb3dsdzVBOBh/a/FLDjZbiG4 71GI3qk8hr7iFaVQbrP8GqRWi00UZnbGKpRBHfOq+osBFpywnbXCC1PTNuQSUmX69kCN 2G5IcgWfmcq2Ub/AscAnvt4+iaei+12nwAPUpsIYiRMd7Q1KKEwtVZHyXJxnIcg471R/ 0gTxzxGzEbwuqM2tX8O1JaBBdplclsLVo9Qnkp2vZUEANx9xm3HRm/AJaZPL//a5ah8w 2ig7Tk4mKldBISyuI1JMIpGWomQotKoNCjaxshXhkSRPTxe/orXGHTzlDtLkpdYhhHN0 QJMQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1751280930; x=1751885730; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=frvu7ZTIUINqXjF+nSUy9As7k0UmZ26XWADo78G3s9U=; b=dRjSEi5vPx1Wz4W4ZZbyN0CTMSzQXBtilgAAhSJpHQNXQa4lilaU8ReucSlHrY6pN2 bwYNbdEyPDmlYiqs8nhYp1W/B3Ki3SQ+7WN+FiEWI/spIeez3MRPg0ErwN29G+rz6TcW wSxwNdIC9OfrzXf26Oaj2WorHKbcCufMMxH1EBQztKfjZyL24Wg7UZ56AMdV54Ml70AG nG3UFULZNk7XAiCIahzG4VRdwswTKUZ2j5LUgDoa+lpHjsjq/Kwgph16ga7LuefpoTnP G1nWbHdfmhCRPoS1qyiv/FAxwF6IGxbRkurrZDveomnsOElmwJ9FwP7ysEXX6PzCExYW BmRA== X-Forwarded-Encrypted: i=1; AJvYcCUKQiVJxoZqpZ2Fr+9afvS5UCdByqQ0kQlldsSTM8SLdoTPtXxbVx4CkBNLL0j9yTkpvSsOmhKb2Z3U5L2e@lists.postgresql.org X-Gm-Message-State: AOJu0Yy91C3mCMouiwdUPMO+FCBadaqEup5qwBFOTT/Q9NFtLXbnWv31 Rzc2AVLIXBAILCgXS7wcm2/2GCeOVFArJcL4tGsRl1OvrNfDlnHCCktSfBoUT82gwA3O0D33hs5 e5N5aTSFFPwdfRNky3LWPDETFj07Ifiw= X-Gm-Gg: ASbGncvS0aWnFzn8YtIl7ZB4XLLwGO/m1jubw4ar6U7YnJxYXjENEF+UqnTdOJqLdZ2 x0qAqeGz4yAKQZ+FR9FMA8TTHGSxaVwoKhSWCvNKtIz3RotcAOg2+c6JdH9sMQqhMMKjnv+h3VY 45Xfmff2m3/l0BzzTlJG8Xe3yDwJfOqdZkc9lNYzEuP3O/hQ== X-Google-Smtp-Source: AGHT+IGbQU5FxkOgJPDKFkynTzCGYnEctJHUzh2sl2o9QR0YGfQpCMFwhtde2iOD6YItYcBRp1c06OuQeeWNRAGxKwI= X-Received: by 2002:a17:903:22d2:b0:235:e1d6:4e22 with SMTP id d9443c01a7336-23ac40f4760mr147308635ad.18.1751280929994; Mon, 30 Jun 2025 03:55:29 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: shveta malik Date: Mon, 30 Jun 2025 16:25:18 +0530 X-Gm-Features: Ac12FXwAG1vE084BZsgDSKIqcFL1CdE1087vRKDeSWoBYXQjrKdePnttF_x5D5Q Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: Peter Smith , Amit Kapila , "Zhijie Hou (Fujitsu)" , vignesh C , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers , shveta malik Content-Type: text/plain; charset="UTF-8" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Few more comments on 002: 5) +GetAllTablesPublicationRelations(Oid pubid, bool pubviaroot) { + List *exceptlist; + + exceptlist = GetPublicationRelations(pubid, PUBLICATION_PART_ALL); a) Here, we are assuming that the list provided by GetPublicationRelations() will be except-tables list only, but there is no validation of that. b) We are using GetPublicationRelations() to get the relations which are excluded from the publication. The name of function and comments atop function are not in alignment with this usage. Suggestion: We can have a new GetPublicationExcludeRelations() function for the concerned usage. The existing logic of GetPublicationRelations() can be shifted to a new internal-logic function which will accept a 'except-flag' as well. Both GetPublicationRelations() and GetPublicationExcludeRelations() can call that new function by passing 'except-flag' as false and true respectively. The new internal function will validate 'prexcept' against that except-flag passed and will return the results. 6) Before your patch002, GetTopMostAncestorInPublication() was checking pg_publication_rel and pg_publication_namespace to find out if the table in the ancestor-list is part of a given particular. Both pg_publication_rel and pg_publication_namespace did not have the entry "for all tables" publications. That means GetTopMostAncestorInPublication() was originally not checking whether the given puboid is an "for all tables" publication to see if a rel belongs to that particular pub or not. I But now with the current change, we do check if pub is all-tables pub, if so, return relid and mark ancestor_level (provided table is not part of the except list). IIUC, the result in 2 cases may be different. Is that the intention? Let me know if my understanding is wrong. thanks Shveta