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 1neTTc-0006SV-Mc for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 03:15:28 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1neTTa-0005au-7j for pgsql-hackers@arkaria.postgresql.org; Wed, 13 Apr 2022 03:15:26 +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 1neTTZ-0005ak-Ss for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 03:15:25 +0000 Received: from mail-ej1-x633.google.com ([2a00:1450:4864:20::633]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1neTTX-0003jt-Ht for pgsql-hackers@lists.postgresql.org; Wed, 13 Apr 2022 03:15:25 +0000 Received: by mail-ej1-x633.google.com with SMTP id bh17so1246601ejb.8 for ; Tue, 12 Apr 2022 20:15:23 -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=5UmVka+HLHE8Ww8OnyjL938XZ+nAlpwsIXXcpir+qmQ=; b=LwTw3p38jNt8z9b/ise8Wb8+DcrLujn6BVU+8fWVhuF9cAWG2yEiuit9SIfaUTtUAs OzwX0xTKK0APCU2/tbsAGsigXmSsuH+c90LkLvgE1m2H6ekcM0P6SF8aMhiQS5fDBN7A 0vT2rIG3liysb3te7Bj15cNPCOmUymXE79YbJmIhpunKD8i57oTF+3O44RVTU4tZUvpg ZKOfuZ+zW5Hviq5VjgrRpidB9G4y5uv5nIgob1Uer9RsR/HjCw8s9EQLRugdO6Rwl0VI nIPnCuwJepdiVMQtnRy+Xg2NbNwy1dL4fv74TF9bWmjg7/yhpn6btrAtM4Gc9dmks3bY dMJw== 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=5UmVka+HLHE8Ww8OnyjL938XZ+nAlpwsIXXcpir+qmQ=; b=RcXI/3yt3BhJyUk9YjMgXWQvEmyW9cf49jF+Xa2ytrUmwOWplTVsfIJmZgOEFPLjrW ychCjJ8HidqSKgKz8JjNGOmnPSWKi//s+c61mDZJWu1a9hXa80CoqzswHTID1k9L/tkJ qoTyLgcUMsQd63wuJhOk1FjckkztnaldjJ8JcWHBTT5ZMBYKs9m9gmqJ/L/CEEVOblw3 keq0TMhLD17Rt8O+uDqQ5AUJJEzWNgWTwrlaUoeExKPBjimsX4vcVPm0NAYhO41B89qH iivKvAvrNnMcvY8G1Ngm+WtEjNx/7aDKC8KQ4jOkVvf3fsfFidTAt2kPm/Rhrh/Aw2pv Dd/g== X-Gm-Message-State: AOAM531YMwaipSvhYxk52fXiE7WLJRv6EoZJqQQ5+YWCgq39C9TF9uwt pI2A7j63LVt0WKJ9op9//VBr00gu3++3YJso0CE= X-Google-Smtp-Source: ABdhPJwCoOMH2XzFHaZlL0cCECgjodqtA362dptb7M9uVLGO5LYTMm+cGiGrhFk0QX8iWhQKIlllGj+61v8P2tUYbEw= X-Received: by 2002:a17:906:c151:b0:6e8:9cbc:ac04 with SMTP id dp17-20020a170906c15100b006e89cbcac04mr9396211ejc.423.1649819721540; Tue, 12 Apr 2022 20:15:21 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: vignesh C Date: Wed, 13 Apr 2022 08:45:10 +0530 Message-ID: Subject: Re: Skipping schema changes in publication To: Amit Kapila 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 Tue, Apr 12, 2022 at 4:46 PM Amit Kapila wrote: > > On Tue, Apr 12, 2022 at 4:17 PM vignesh C wrote: > > > > On Tue, Apr 12, 2022 at 12:19 PM Amit Kapila wrote: > > > > > > > > > For the second syntax (Alter Publication ...), isn't it better to > > > avoid using ADD? It looks odd to me because we are not adding anything > > > in publication with this sytax. > > > > I was thinking of the scenario where user initially creates the > > publication for all tables: > > CREATE PUBLICATION pub1 FOR ALL TABLES; > > > > After that user decides to skip few tables ex: t1, t2 > > ALTER PUBLICATION pub1 ADD SKIP TABLE t1,t2; > > > > I thought of supporting this syntax if incase user decides to add the > > skipping of a few tables later. > > > > 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. But I'm fine doing it either way to keep it simple for the user. Regards, Vignesh