Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrNnR-0006Lf-NR for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 17:49:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nrNnQ-0001lC-Hz for pgsql-hackers@arkaria.postgresql.org; Wed, 18 May 2022 17:49:16 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nrNnQ-0001l3-8z for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 17:49:16 +0000 Received: from mail-ed1-x536.google.com ([2a00:1450:4864:20::536]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nrNnN-0005x7-L3 for pgsql-hackers@lists.postgresql.org; Wed, 18 May 2022 17:49:15 +0000 Received: by mail-ed1-x536.google.com with SMTP id en5so4004464edb.1 for ; Wed, 18 May 2022 10:49:13 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=AvTiENHUWNrsLqezF11Ym2SBKxdTG5PKAp8CFyXM1sM=; b=qklPB5gCwmLqkEUNJ3tTqk0Sq/vzb2hIeJUsJFsk5ah4/KAUSXFMrUUcp+0LrxLtk0 O8VF8v4svYYdr5mjL+/FJi4pih+7SIvd06GTjyD4WsCGHyTLhVDIlKO6mtVFMGYGw80W 3xxBXIGCCJFH/51gxAxN4zDNOjhHiHx4dHvVtlNbbIRiG3dWZZV4h8AsvP/APHviNoVX r5pzV28NW4gIsue/JADDQcmT20vpfu83Rywo+24dp3wSP3O482xuQHY5ADRc3L4DIlqz LJ3p6wgIuwbNzcPoZtirGPhpep+agyn//qgAp794r2PZ69BGlvwYJ4YXgVQzerxGbr0n nRiQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=AvTiENHUWNrsLqezF11Ym2SBKxdTG5PKAp8CFyXM1sM=; b=hdomF3YsHmJMjGiFfUHPF3lQs7LQiP988MuG7hadl1soVrF/zER4/9huzufnHxIqJ/ 25rfXa4+QtT0s22SepGiUULf3OSEfSDPtAPMVFtVlMliof6W5Qb76Zkp89i8Eu0padjT ICFJ93ccO0EfRwokfM6qUc9DmLXvlnseafGscKDzSYQoyhvn0fCzXr8Ssyf1TMo/RcZW T4FPN9geDXv6RZZgjeBeJN6fP0P9B2y7cYC/U6R50o3G0WO5VXOpsblgqWb1lgr6Qkwq 41eJ9+36UiPR1iG7NuDqTYVMJ8g5AbsbVuq3gq+yVZuL+/laa6yMvGQ7nOcrj8ct78Gb mekg== X-Gm-Message-State: AOAM531PdVHhyMhaFfNgfxGTdv8lwoYPujmjZjWtV0BTOhmTbEYlzoJO n2K36e9aGRCD6Q/vmBsRaDJne4PFms3p6v+olsQ= X-Google-Smtp-Source: ABdhPJxKWZcmvM2GTLi0h1qNhgYqpHbdX7bwEi3IO089xMfHUAES2HCDCzdvYw410LLompK+dxa4xWQ2fLXrWQaKmX0= X-Received: by 2002:a05:6402:2999:b0:428:bb4d:6cea with SMTP id eq25-20020a056402299900b00428bb4d6ceamr984512edb.29.1652896152765; Wed, 18 May 2022 10:49:12 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: vignesh C Date: Wed, 18 May 2022 23:19:01 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: "shiy.fnst@fujitsu.com" Cc: Peter Smith , Amit Kapila , Bharath Rupireddy , 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 On Wed, May 18, 2022 at 8:30 AM shiy.fnst@fujitsu.com wrote: > > On Sat, May 14, 2022 9:33 PM vignesh C wrote: > > > > Thanks for the comments, the attached v5 patch has the changes for the > > same. Also I have made the changes for SKIP Table based on the new > > syntax, the changes for the same are available in > > v5-0002-Skip-publishing-the-tables-specified-in-EXCEPT-TA.patch. > > > > Thanks for your patch. Here are some comments on v5-0001 patch. > > + Oid relid = lfirst_oid(lc); > + > + prid = GetSysCacheOid2(PUBLICATIONRELMAP, Anum_pg_publication_rel_oid, > + ObjectIdGetDatum(relid), > + ObjectIdGetDatum(pubid)); > + if (!OidIsValid(prid)) > + ereport(ERROR, > + (errcode(ERRCODE_UNDEFINED_OBJECT), > + errmsg("relation \"%s\" is not part of the publication", > + RelationGetRelationName(rel)))); > > I think the relation in the error message should be the one whose oid is > "relid", instead of relation "rel". Modified it > Besides, I think it might be better not to report an error in this case. If > "prid" is invalid, just ignore this relation. Because in RESET cases, we want to > drop all tables in the publications, and there is no specific table. > (If you agree with that, similarly missing_ok should be set to true when calling > PublicationDropSchemas().) Ideally this scenario should not happen, but if it happens I felt we should throw an error in this case. The v6 patch attached at [1] has the changes for the same. [1] - https://www.postgresql.org/message-id/CALDaNm0iZZDB300Dez_97S8G6_RW5QpQ8ef6X3wq8tyK-8wnXQ%40mail.gmail.com Regards, Vignesh