Re: Skipping schema changes in publication
Amit Kapila <amit.kapila16@gmail.com>
From: Amit Kapila <amit.kapila16@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>, Masahiko Sawada <sawada.mshk@gmail.com>, "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>,
shveta malik <shveta.malik@gmail.com>, Shlok Kyal <shlok.kyal.oss@gmail.com>,
Nisha Moond <nisha.moond412@gmail.com>, Ashutosh Sharma <ashu.coek88@gmail.com>,
"David G. Johnston" <david.g.johnston@gmail.com>, Dilip Kumar <dilipbalaut@gmail.com>,
"Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, YeXiu <1518981153@qq.com>, Ian Lawrence Barwick <barwick@gmail.com>, Bharath Rupireddy <bharath.rupireddyforpostgres@gmail.com>, PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Date: 2026-03-16T08:49:47Z
Lists: pgsql-hackers
On Mon, Mar 16, 2026 at 12:06 PM Peter Smith <smithpb2250@gmail.com> wrote:
>
> ======
> src/backend/commands/tablecmds.c
>
> ATExecAttachPartition:
>
> 3.
> + bool first = true;
> + StringInfoData pubnames;
> +
> + initStringInfo(&pubnames);
> +
> + foreach_oid(pubid, exceptpuboids)
> + {
> + char *pubname = get_publication_name(pubid, false);
> +
> + if (!first)
> + {
> + /*
> + * translator: This is a separator in a list of publication
> + * names.
> + */
> + appendStringInfoString(&pubnames, _(", "));
> + }
> +
> + first = false;
> +
> + appendStringInfo(&pubnames, _("\"%s\""), pubname);
> + }
>
> 3a.
> Why is appendStringInfo(&pubnames, _("\"%s\""), pubname) using the
> "_(" macro?. AFAIK it does not make sense to call gettext() for a
> pubname.
>
Why? I see a similar usage in logicalrep_get_attrs_str().
> ~
>
> 3b.
> Postgres already has a function to make a CSV list of pubnames. Can't
> we build a list of pubnames here, then just call the common
> 'GetPublicationsStr' to get that as a CSV string. PSA a patch
> demonstrating what I mean.
>
Here you are first forming a list then adding commas to it by parsing
it. I think such a duplicate effort is not required.
--
With Regards,
Amit Kapila.
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix miscellaneous issues in EXCEPT publication clause.
- 6b0550c45d13 19 (unreleased) landed
-
Change syntax of EXCEPT TABLE clause in publication commands.
- 5984ea868eee 19 (unreleased) landed
-
Add support for EXCEPT TABLE in ALTER PUBLICATION.
- 493f8c6439cf 19 (unreleased) landed
-
Allow table exclusions in publications via EXCEPT TABLE.
- fd366065e06a 19 (unreleased) landed
-
Add wait_for_subscription_sync for TAP tests.
- 0c20dd33db16 16.0 cited