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 1neUna-00035Q-QW for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 04:40:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neUnZ-0000Gd-Ds for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 04:40:09 +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 1neUnZ-0000GU-2a for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 04:40:09 +0000 Received: from mail-yw1-x112a.google.com ([2607:f8b0:4864:20::112a]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neUnU-0004SE-2D for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 04:40:08 +0000 Received: by mail-yw1-x112a.google.com with SMTP id 00721157ae682-2ebd70a4cf5so9832407b3.3 for ; Tue, 12 Apr 2022 21:40:03 -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=L7fYMFgi3Ss2pWl3WWNtmozECu8aDP46DpSOK3WxvOA=; b=orx/9E47LLJYIiYdnk0QiuhgKOHn8XO3iCgV2nJI5pWRpkV3h+dtqu+pIvrwCpkT1q ur5SjX6MKQmSXTFAIX01IaJ90bCF2ULaDc3BTwOTb4WwNSJjJEBXSrMNfzejO4VVpjaT FZ1TDxPiua4/8JRWRTWc4FgsVM/VaxBoJJ/VjJ7pHH+1Oos+zF1pwWBOhq8j+AHH2xO/ i6c+G2wOmDcJdz9a8NFHDFd11BzgUkgyQmvdMe4S1BEiz6MLCO0XJpbHbTkXek6jnwlq fxhHKPHVOaTn4FmgOX7sxi2KeOu0F8bAoj9QJKh5hmi1xQe7UuqahhYvHqfZh/o+OH1O YnVQ== 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=L7fYMFgi3Ss2pWl3WWNtmozECu8aDP46DpSOK3WxvOA=; b=cKSadaph9U/A/QPZjZ25sXA1oMXEwZnkBBVa83Axy29At+Vt3jhkFAJEGEmbNlbau8 sOcUNv5WQf4UrLMmdEiFNe8GMvstqpQ3fQPYvNI6jA3r50sci2Gfn3NtAhTN27zIE/N+ e83hkAdmGACcAOZWiQnrTQg0RG636gJ1HBq2r8d111TTpmQ9LwOZFwt+JAKRI7TwupA6 B2rnYrznbGvXgBJQffp/obIWQC7tje+Db5nzAxzpj1XfM3RhuBhFDOw+tRZyW8OQ1k39 NPITyDWyN/1iG6wDsxfc5UO0vZCPXndqN/vAmp+Um9vS3CCtIsFVqoPf7aLgjFtBH8Vv tlaQ== X-Gm-Message-State: AOAM5337DX59LOBTkUdloAzUw3MksHfslsq/pfP13aTNPTaXoJuG1fds NI3vWQrlIOmEYnIcwXlYBIBuecw/PFtWwcxa6hc= X-Google-Smtp-Source: ABdhPJwnTUz6iirs8YhfBeIwjQDLfEiBkC3eLLW4KZN+o5vj9F34xaDrEn6UJUJ72xuo3DG2tb4HPQEYTR/L7j+Jsvg= X-Received: by 2002:a81:89:0:b0:2eb:f118:291b with SMTP id 131-20020a810089000000b002ebf118291bmr17864842ywa.84.1649824802061; Tue, 12 Apr 2022 21:40:02 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Amit Kapila Date: Wed, 13 Apr 2022 10:09:51 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: vignesh C Cc: 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, Apr 13, 2022 at 8:45 AM vignesh C wrote: > > On Tue, Apr 12, 2022 at 4:46 PM Amit Kapila wrote: > > > > I understand that part but what I pointed out was that it might be > > better to avoid using ADD keyword in this syntax like: ALTER > > PUBLICATION pub1 SKIP TABLE t1,t2; > > Currently we are supporting Alter publication using the following syntax: > ALTER PUBLICATION pub1 ADD TABLE t1; > ALTER PUBLICATION pub1 SET TABLE t1; > ALTER PUBLICATION pub1 DROP TABLE T1; > ALTER PUBLICATION pub1 ADD ALL TABLES IN SCHEMA sch1; > ALTER PUBLICATION pub1 SET ALL TABLES IN SCHEMA sch1; > ALTER PUBLICATION pub1 DROP ALL TABLES IN SCHEMA sch1; > > I have extended the new syntax in similar lines: > ALTER PUBLICATION pub1 ADD SKIP TABLE t1; > ALTER PUBLICATION pub1 SET SKIP TABLE t1; > ALTER PUBLICATION pub1 DROP SKIP TABLE T1; > > I did it like this to maintain consistency. > What is the difference between ADD and SET variants? I understand we need some way to remove the SKIP table setting but not sure if DROP is the best alternative. The other ideas could be: To set skip tables: ALTER PUBLICATION pub1 SKIP TABLE t1, t2...; To reset skip tables: ALTER PUBLICATION pub1 SKIP TABLE; /* basically an empty list*/ Yet another way to reset skip tables: ALTER PUBLICATION pub1 RESET SKIP TABLE; /* Here we need to introduce RESET. */ -- With Regards, Amit Kapila.