On Tue, Feb 1, 2022 at 2:45 PM
houzj.fnst@fujitsu.com <
houzj.fnst@fujitsu.com> wrote:
>
> On Monday, January 31, 2022 9:02 PM Amit Kapila <
amit.kapila16@gmail.com>
> >
> > 2.
> > + if (pubrinfo->pubrelqual)
> > + appendPQExpBuffer(query, " WHERE (%s)", pubrinfo->pubrelqual);
> > + appendPQExpBufferStr(query, ";\n");
> >
> > Do we really need additional '()' for rwo filter expression here? See the below
> > output from pg_dump:
> >
> > ALTER PUBLICATION pub1 ADD TABLE ONLY public.t1 WHERE ((c1 < 100));
>
> I will investigate this and change this later if needed.
>
I don't think we can make this change (i.e. remove the additional parentheses), because then a "WHERE (TRUE)" row filter would result in invalid pg_dump output:
e.g. ALTER PUBLICATION pub1 ADD TABLE ONLY public.test1 WHERE TRUE;
(since currently, parentheses are required around the publication WHERE expression)
See also the following commit, which specifically added these parentheses and catered for WHERE TRUE:
Regards,
Greg Nancarrow
Fujitsu Australia