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 1uRhEc-00F6GU-UE for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jun 2025 01:05:03 +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 1uRhEa-00EJHS-LH for pgsql-hackers@arkaria.postgresql.org; Wed, 18 Jun 2025 01:05:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1uRhEa-00EJHK-4U for pgsql-hackers@lists.postgresql.org; Wed, 18 Jun 2025 01:05:00 +0000 Received: from mail-qt1-x836.google.com ([2607:f8b0:4864:20::836]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1uRhEZ-002cJC-02 for pgsql-hackers@lists.postgresql.org; Wed, 18 Jun 2025 01:04:59 +0000 Received: by mail-qt1-x836.google.com with SMTP id d75a77b69052e-4a58c2430edso2997911cf.1 for ; Tue, 17 Jun 2025 18:04:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1750208698; x=1750813498; darn=lists.postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=omIX8BLcr2ajJ7bWCcgIvE48lqVD6KjE7dO/vAvyeIE=; b=MQE6lZtfih/ZaNGR4iTHtWggH7Dwq+CJYBTaZ2keh7kqTkNofynKRM58AZkROxSm5W 3h0EuDrQtnEoc8jzOPNJpn25lS2OUxdSS1Nh8fB92VzDK3E8O7V5PNh/YDh4IIOxSIYF Ft2ypAFrTkAccgEjC64lyFDpGQ7IbfnuOPZ97oGRBIC8oeLerVYkQtB68LyX+Oh2Pa+R bDVK+Rl8+2NN4v8hraeXcIItvX3BJt2Cm2HIEBwv6J+jXrmYrUFC7H/sgX5CwVdgDKU3 U6igGibSYEOwY8H1uxNoeV77m0xiBNkpBUB8oBUOo/PO1riR93QwVPWGkorDBuJ586Ij FsMw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1750208698; x=1750813498; h=content-transfer-encoding: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=omIX8BLcr2ajJ7bWCcgIvE48lqVD6KjE7dO/vAvyeIE=; b=Yhc2jIy3L7SSoCBifV6g3uhWIUzPjx8H/kIr7vGsj0M6qHrDSSV5QBeTjLLpuw/9Y9 KWsbkE0oIUQOSrjiYqqpccnTJEfM/fYlpOf0ioZDHYAHKOv780ZZSczOMK/3ZkpdSvxn c4Lf5BsQOSqxigw7UC1G+jLLaf/Tylu88P07r0MP5VC2o+cYvwh6VMZIOJkelVGjpz7E k/7efvk4oDXSN7FQoxA98iLpDY/2gkAQghL1ZmvxQhdgKbRzHsRqepg/+SMT88DPuAGz 5MPNjD0hDC1XYD86Hdfgi4TCGZx74QGTJl2tGwU6Pz3vri66ePhhHq+MSrU1lBNT4nL1 m/qg== X-Forwarded-Encrypted: i=1; AJvYcCUDMFPOYayFOvzxySBs/2Gnjyi2k2osJOkpYKSgsFWmqMwdE2hufje0tzZfqCeOjhEVKtd+GvdO3zm4f9X7@lists.postgresql.org X-Gm-Message-State: AOJu0Yw5eXcnZBO6dI8qFosxsJ+b/VJFMFAin9HbaYh9zjhq17P1wCcG xYZoVjRFePg4McvwSp+NoAq5mCqZTnr45WHuWEF+scZiMtyRJch4LwQHb2s+nH6/jtK9vhkv1tt vNWa2TUjalMJuz+oypQoifdIznOrOgP0= X-Gm-Gg: ASbGncvmOrLeJ4tf2b8sKyM0gVbNeEbDsicIjVpPnpZzSCoyQ/GWlVQKgtIL+ZA7LjT WqZnsSbVYvKMpcoJbg4xTFLD2iXgblMyT7Dx1AqbwSzy8Lfvb7l1DXlsRzpBo/fR2dzHpMr1ZRT MwhFLn6CRu2hMQRR5GdraEmFjW/jnLM2MYN7OqFmgpdQW+/l07ooTtrQ== X-Google-Smtp-Source: AGHT+IGZQzUNiZaTTD3olMqfa3HnLSumiroPP9xa6zrKDCTA0mkj6rCriELjs/jZPEMR7N+CV1IbjdOUasAYA81TdVk= X-Received: by 2002:a05:622a:1b8d:b0:49a:6859:1c10 with SMTP id d75a77b69052e-4a7645db718mr11981171cf.24.1750208698117; Tue, 17 Jun 2025 18:04:58 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Peter Smith Date: Wed, 18 Jun 2025 11:04:31 +1000 X-Gm-Features: AX0GCFsglLrad1ozKpyBShtvUMEQmOf8HdiutdykR7qvHjmmtnGz5PSCleXXxKE Message-ID: Subject: Re: Skipping schema changes in publication To: Shlok Kyal Cc: Amit Kapila , "Zhijie Hou (Fujitsu)" , vignesh C , YeXiu <1518981153@qq.com>, Ian Lawrence Barwick , Bharath Rupireddy , PostgreSQL Hackers Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Tue, Jun 17, 2025 at 5:41=E2=80=AFPM Shlok Kyal wrote: ... > I have attached a patch support excluding columns for publication. > > I have added a syntax: "FOR TABLE table_name EXCEPT (c1, c2, ..)" > It can be used with CREATE or ALTER PUBLICATION. > > v12-0003 patch contains the changes for the same. > Hi Shlok, I was interested in your new EXCEPT (col-list) so I had a quick look at your patch v12-0003 (only looked at the documentation). Below are some comments: =3D=3D=3D=3D=3D=3D 1. Chapter 29.5 "Column Lists". I think new EXCEPT syntax needs a mention here as well. =3D=3D=3D=3D=3D=3D doc/src/sgml/catalogs.sgml 2. + + This is an array of values that indicates which table columns are + excluded from the publication. For example, a value of + 1 3 would mean that the columns except the first= and + the third columns are published. + A null value indicates that no columns are excluded from being published. + The sentence "A null value indicates that no columns are excluded from being published" seems kind of confusing, because if the user has a "normal" column-list although nothing was being *explicitly* excluded (using EXCEPT), any columns not named are *implicitly* excluded from being published. ~ 3. TBH, I was wondering why a new catalog attribute was necessary... Can't you simply re-use the existing attribute "prattrs" attribute. e.g. let's just define negative means exclude. e.g. a value of 1 3 means only the 1st and 3rd columns are published e.g. a value of -1 -3 means all columns except 1st and 3rd columns are publ= ished e.g. a value of null mean all columns are published (mixes of negative and positive will not be possible) =3D=3D=3D=3D=3D=3D doc/src/sgml/ref/alter_publication.sgml 4. ALTER PUBLICATION syntax The syntax is currently written as: TABLE [ ONLY ] table_name [ * ] { [ [ ( column_name [, ... ] ) ] | [ EXCEPT ( column_name [, ... ] ) ] ] } [ WHERE ( expression ) ] [, ... ] Can't this be more simply written as: TABLE [ ONLY ] table_name [ * ] [ [ EXCEPT ] ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] ~~~ 5. + + Alter publication mypublication to add table + users except column + security_pin: + +ALTER PUBLICATION production_publication ADD TABLE users EXCEPT (security_= pin); Those tags don't seem correct. e.g. "users" and "security_pin" are not (???). Perhaps, every other example here is wrong too and you just copied them? Anyway, something here looks wrong to me. =3D=3D=3D=3D=3D=3D doc/src/sgml/ref/create_publication.sgml 6. CREATE PUBLICATION syntax The syntax is currently written as: TABLE [ ONLY ] table_name [ * ] { [ [ ( column_name [, ... ] ) ] | [ EXCEPT ( column_name [, ... ] ) ] ] } [ WHERE ( expression ) ] [, ... ] Can't this be more simply written as: TABLE [ ONLY ] table_name [ * ] [ [ EXCEPT ] ( column_name [, ... ] ) ] [ WHERE ( expression ) ] [, ... ] ~~~ 7. + + When a column list is specified with EXCEPT, the named columns are n= ot + replicated. The excluded column list cannot contain generated columns. The + column list and excluded column list cannot be specified together. + Specifying a column list has no effect on TRUNCATE + commands. + IMO you don't need to say "The column list and excluded column list cannot be specified together." because AFAIK the syntax makes that impossible to do anyhow. ~~~ 8. + + Create a publication that publishes all changes for table users + except changes for columns security_pin: + +CREATE PUBLICATION users_safe FOR TABLE users EXCEPT (security_pin); + + 8a. Same review comment as previously -- Those tags don't seem correct. e.g. "users" and "security_pin" are not (???). Again, are all the other existing tags also wrong? Maybe a new thread needed to address these? ~ 8b. Plural? /except changes for columns/except changes for column/ =3D=3D=3D=3D=3D=3D Kind Regards, Peter Smith. Fujitsu Australia