Re: CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned

From: vignesh C <vignesh21(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: CREATE PUBLICATION with 'publish_generated_columns' parameter specified but unassigned
Date: 2025-08-05 04:28:33
Message-ID: CALDaNm1xPktwns7KP9xFSUx6Jo1FRBQQa_GkwCdD2sxi8BMZrw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, 5 Aug 2025 at 05:35, Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
>
> Here is a v1 patch, where:
>
> - now user gets ERROR if the 'publish_generated_columns' parameter is
> specified without a value
> - regression tests are updated

Few comments:
1) Generally in other case we throw the following error "option
requires a parameter" for example:
postgres=# create subscription sub3 connection 'dbname=postgres
port=5432' publication pub1 with (synchronous_commit );
ERROR: synchronous_commit requires a parameter

postgres=# create publication pub1 for all tables with ( publish);
ERROR: publish requires a parameter

How about keeping it similar here too with below code:
/*
* A parameter value is required.
*/
if (def->arg == NULL)
ereport(ERROR,
(errcode(ERRCODE_SYNTAX_ERROR),
errmsg("%s requires a parameter",
def->defname)));

2) This gets tested via other publication like testpub4, so this test
is not required:
-CREATE PUBLICATION pub3 FOR ALL TABLES WITH (publish_generated_columns);
+CREATE PUBLICATION pub3 FOR ALL TABLES;
\dRp+ pub3
Publication pub3
Owner | All tables | Inserts | Updates | Deletes
| Truncates | Generated columns | Via root
--------------------------+------------+---------+---------+---------+-----------+-------------------+----------
- regress_publication_user | t | t | t | t
| t | stored | f
+ regress_publication_user | t | t | t | t
| t | none | f
(1 row)

This change is required for PG18 too, your patch applies for the PG18
branch also.

Regards,
Vignesh

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Paul A Jungwirth 2025-08-05 04:45:21 Re: PoC: adding CustomJoin, separate from CustomScan
Previous Message Amit Kapila 2025-08-05 04:20:09 Re: Dropping publication breaks logical replication