Re: Add support for specifying tables in pg_createsubscriber. - Mailing list pgsql-hackers

From vignesh C
Subject Re: Add support for specifying tables in pg_createsubscriber.
Date
Msg-id CALDaNm3EcjxPu5nt3_O5dbzbzh+nyjHuHUYta0YPzJrxoH1EKg@mail.gmail.com
Whole thread Raw
In response to RE: Add support for specifying tables in pg_createsubscriber.  ("Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>)
Responses RE: Add support for specifying tables in pg_createsubscriber.
List pgsql-hackers
On Fri, 1 Aug 2025 at 13:33, Zhijie Hou (Fujitsu)
<houzj.fnst@fujitsu.com> wrote:
>
> On Monday, July 28, 2025 1:07 PM Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com> wrote:
> >
> > Dear Shubham,
> >
> > > The attached patch introduces a new '--table' option that can be
> > > specified after each '--database' argument.
> >
> > Do we have another example which we consider the ordering of options? I'm
> > unsure
> > for it. Does getopt_long() always return parsed options with the specified
> > order?
> >
> > > The syntax is like that used in 'vacuumdb'
> > > and supports multiple '--table' arguments per database, including
> > > optional column lists and row filters.
> >
> > Vacuumdb nor pg_restore do not accept multiple --database, right?
> > I'm afraid that current API has too complex.
>
> We have another example to consider: pg_amcheck, which allows users to specify
> multiple databases. Following this precedent, it may be beneficial to adopt a
> similar style in pg_createsubscriber. E.g., Users could specify tables using
> database-qualified names, such as:
>
> ./pg_createsubscriber --database db1 --table 'db1.public.t1' --table
> 'db1.public.t2(a,b) WHERE a > 100' --database db2 --table 'db2.public.t3'

pg_amcheck allows specifying tables as a pattern, the below note is from [1]:
Patterns may be unqualified, e.g. myrel*, or they may be
schema-qualified, e.g. myschema*.myrel* or database-qualified and
schema-qualified, e.g. mydb*.myschema*.myrel*. A database-qualified
pattern will add matching databases to the list of databases to be
checked.

In pg_createsubscriber will it be using the exact spec of pg_amcheck
or will the user have to give fully qualified names?

[1] - https://www.postgresql.org/docs/devel/app-pgamcheck.html

Regards,
Vignesh



pgsql-hackers by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: Datum as struct
Next
From: Etsuro Fujita
Date:
Subject: Re: [(known) BUG] DELETE/UPDATE more than one row in partitioned foreign table