On Wed, Jan 29, 2025 at 4:44 PM Amit Kapila <amit.kapil...@gmail.com> wrote: > > On Tue, Jan 28, 2025 at 12:01 PM Ashutosh Bapat > <ashutosh.bapat....@gmail.com> wrote: > > > > If we want to stick to --database= supporting a pattern looks better > > than just a single special pattern *. > > > > This sounds reasonable to me as well. Note that the interaction of > other parameters like --replication-slot is not yet discussed. I think > if the number of slots given matches with the number of databases > fetched based on pattern matches then we can use them otherwise, > return the ERROR. The other option could be that we don't allow > options like --replication-slot along with pattern matching option. >
I have had second thoughts about my pattern idea. Now, I favour just adding another --all-databases switch like Ashutosh had suggested [1] in the first place. I had overlooked the rules saying that the user is allowed to specify *multiple* --publication or --replication-slot or --subscription name switches, but when doing so they have to match the same number of --database switches. Using a --dbname=pattern would be fraught with complications. e.g. How can we know up-front how many databases the dbname pattern will resolve to, and even in what order they get resolved? In hindsight, it would be much easier to just have one extra switch, so the rules then are simple: --all-databases (here you CANNOT specify multiple publication/replication-slot/subscription switches) -database=dbname (here you CAN specify multiple publication/replication-slot/subscription switches using the same order and the same number as databases) Also, --all-databases and --database switches cannot be specified at the same time. ====== [1] https://www.postgresql.org/message-id/CAExHW5sQGie7bvS-q7YUYDM2BqYZ%3D%2BxqeqFUS%3DcZGjK_9pnVzQ%40mail.gmail.com Kind Regards, Peter Smith. Fujitsu Australia