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 1nloJ5-0001jN-2m for pgsql-hackers@arkaria.postgresql.org; Tue, 03 May 2022 08:54:55 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nloJ3-00037V-0T for pgsql-hackers@arkaria.postgresql.org; Tue, 03 May 2022 08:54:53 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nloJ2-00037M-Ly for pgsql-hackers@lists.postgresql.org; Tue, 03 May 2022 08:54:52 +0000 Received: from mail-qk1-x730.google.com ([2607:f8b0:4864:20::730]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1nloJ0-0007lx-Fc for pgsql-hackers@lists.postgresql.org; Tue, 03 May 2022 08:54:51 +0000 Received: by mail-qk1-x730.google.com with SMTP id a22so10037678qkl.5 for ; Tue, 03 May 2022 01:54:50 -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=2xPfien6A2A9tp1Tswnrmfvd9d73WzLdkYsIEvky0TI=; b=KXf67MFNSlzh7ZMEMri9EdPVUT7lHOXQS3g1zARtYEJCgYztDlDs7+MvS4mwwuv6NK R8wONvXjkNv6DZiY9C7wg0zM2YIVn3wMlkv2X7PxpuUK6bSZAWMj/2WP4pYIfHVDDRw5 Q8gxkEBDmLjxPQE5jO5sum6yXlvjtEmXGquTmBR74nz5Cjp71jo+GYEXuYHYlJdcEPKV uV7ZU3t9d1kqG+XEpdpSW/5s9EiyvXNI/4FlKztqHay1ThIgxT7ZelWWgKNx9c5zmVjl UsJ72dbL2VV3ZR3WmW3pkEHL5Q0k5RhbPhWS05MXVw/5Ryp91xGOXY6/mjRJoHo0im+p rsog== 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=2xPfien6A2A9tp1Tswnrmfvd9d73WzLdkYsIEvky0TI=; b=rWrG1FrvOAJWeoUX3cGcwnRlSENNjYAZDjqjMw3BizQf6Ns2SLOmqSN5G2+gZgUGVD Jr1+u2fCPI5ocDxOI9MdReuWNGjbwQFeH8Y2Ortt3KmG2UABB0qcfDwqtHWfGCatnnMz fwB4ba6GG10GRXXk6hbY1DkcPUSgfRIaokwnX/6MgFjMfGdWuLHjAD73GqX/c+0daupU Xjmboz+WAGgHntMPlTIFejl61HZLdwZ1uTUy4z0NJRiISLqDH7n0iffiH3soKQcV6Cuq VzpdizmVF62eyWtdkCg8/Ax5VlpfWLChKUz1BUXeblU2j2H6qOQJ+RacS1ix+0VUZX77 UYOg== X-Gm-Message-State: AOAM531c70q3UcZpv0F2vHKGmEXr5pKdMrTha1M6ecb1Io7cgOoOpJKY maqChzmIdKRzPYIPmKHfdg6B31zqmPTAl1xVW/Q= X-Google-Smtp-Source: ABdhPJyYT3NP1qjKdbZ/CJMcYrrevVunC+T1H3DhTyyuUWmzCVUQsONwea1Tec2nBOOG/V3R9fYab2g1sVTsvleheso= X-Received: by 2002:a05:620a:170f:b0:69f:bfbe:9095 with SMTP id az15-20020a05620a170f00b0069fbfbe9095mr11604081qkb.149.1651568089527; Tue, 03 May 2022 01:54:49 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Tue, 3 May 2022 18:54:33 +1000 Message-ID: Subject: Re: Skipping schema changes in publication To: Amit Kapila Cc: Bharath Rupireddy , vignesh C , 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 Thu, Apr 28, 2022 at 9:32 PM Amit Kapila wrote: > ... > Another idea that occurred to me today for tables this is as follows: > 1. Allow to mention except during create publication ... For All Tables. > CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT TABLE t1,t2; > 2. Allow to Reset it. This new syntax will reset all objects in the > publications. > Alter Publication ... RESET; > 3. Allow to add it to an existing publication > Alter Publication ... Add ALL TABLES [EXCEPT TABLE t1,t2]; > > I think it can be extended in a similar way for schema syntax as well. > Consider if the user does CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT TABLE t1,t2; ALTER PUBLICATION pub1 ADD ALL TABLES EXCEPT t3,t4; What does it mean? e.g. Is there only one exception list that is modified? Or did the ADD ALL TABLES override all meaning of the original list? e.g. Are we now skipping t1,t2,t3,t4, or are we now only skipping t3,t4? ~~~ Here is a similar example, where the ADD TABLE seems confusing to me when it intersects with a prior EXCEPT e.g. CREATE PUBLICATION pub1 FOR ALL TABLES EXCEPT t1,t2; // ok ALTER PUBLICATION pub1 ADD TABLE t1; ??? What does it mean? e.g. Does the explicit ADD TABLE override the original exception list? e.g. Is t1 published now or should that ALTER have caused an error? ~~ It feels like there are too many tricky rules when using EXCEPT with ALTER PUBLICATION. I guess complexities can be described in the documentation but IMO it would be better if the ALTER syntax could be unambiguous in the first place. So perhaps the rules should be more restrictive (e.g. just disallow ALTER ... ADD any table that overlaps the existing EXCEPT list ??) ------ Kind Regards, Peter Smith. Fujitsu Australia.