From: | "Zhijie Hou (Fujitsu)" <houzj(dot)fnst(at)fujitsu(dot)com> |
---|---|
To: | Andrew Dunstan <andrew(at)dunslane(dot)net>, "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>, 'Shubham Khanna' <khannashubham1197(at)gmail(dot)com> |
Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
Subject: | RE: Add support for specifying tables in pg_createsubscriber. |
Date: | 2025-08-01 15:03:26 |
Message-ID: | OS0PR01MB571675E11B67342221A8B1209426A@OS0PR01MB5716.jpnprd01.prod.outlook.com |
Views: | Whole Thread | Raw Message | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Friday, August 1, 2025 8:56 PM Andrew Dunstan <andrew(at)dunslane(dot)net> wrote:
> On 2025-08-01 Fr 4:03 AM, Zhijie Hou (Fujitsu) wrote:
> > On Monday, July 28, 2025 1:07 PM Hayato Kuroda (Fujitsu)
> > mailto:kuroda(dot)hayato(at)fujitsu(dot)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.
>
> I don't think that's quite the point, as I understand it. pg_amcheck might
> allow you to have multiple --database arguments, but I don't think it depends
> on the order of arguments. You didn't answer his question about what
> getopt_long() does. I don't recall if it is free to mangle the argument order.
I think you might misunderstand my proposal. I am suggesting an alternative
interface style that employs database-qualified table names, which doesn't
depend on the order of options. This style is already used by pg_amcheck when
dealing with multiple database specifications. I referenced pg_amcheck as an
example. Please see below:
--
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'
This approach enables the tool to internally categorize specified tables by
database and create publications accordingly.
--
Best Regards,
Hou zj
From | Date | Subject | |
---|---|---|---|
Next Message | Yugo Nagata | 2025-08-01 15:20:27 | Fix a typo of comments in AutoVacLauncherMain |
Previous Message | Alexandra Wang | 2025-08-01 14:58:01 | Re: Pathify RHS unique-ification for semijoin planning |