On Thurs, Sep 16, 2021 10:37 PM Alvaro Herrera <alvherre@alvh.no-ip.org> wrote:
> On 2021-Sep-16, Alvaro Herrera wrote:
>
> Actually, something like this might be better:
>
> > PublicationObjSpec:
>
> > | TABLE qualified_name
> > {
> > $$ = makeNode(PublicationObjSpec);
> > $$->pubobjtype = PUBLICATIONOBJ_TABLE;
> > $$->pubrvobj = $2;
> > $$->location = @1;
> > }
> > | ALL TABLES IN_P SCHEMA name
> > {
> > $$ = makeNode(PublicationObjSpec);
> > $$->pubobjtype = PUBLICATIONOBJ_ALL_TABLES_IN_SCHEMA;
> > $$->pubplainobj = $5;
> > $$->location = @1;
> > }
> So you don't have to cram the schema name in a RangeVar, which would indeed
> be quite awkward. (I'm sure you can come up with better names for the struct
> members there ...)>
Did you mean something like the following ?
-----
PublicationObjSpec:
TABLE qualified_name {...}
| ALL TABLES IN_P SCHEMA name {...}
;
pub_obj_list:
PublicationObjSpec
| pub_obj_list ',' PublicationObjSpec
-----
If so, I think it only supports syntaxes like "TABLE a, TABLE b, TABLE c" while
we cannnot use "TABLE a,b,c". To support multiple objects, we need a bare name
in PublicationObjSpec.
Or Did you mean something like this ?
-----
PublicationObjSpec:
TABLE qualified_name {...}
| ALL TABLES IN_P SCHEMA name {...}
| qualified_name {...}
;
-----
I think this doesn't support relation expression like "table */ONLY table/ONLY
(table)" as memtioned by Vignesh [1].
Thoughts ?
[1] https://www.postgresql.org/message-id/CALDaNm06%3DLDytYyY%2BxcAQd8UK_YpJ3zMo4P5V8KBArw6MoDWDg%40mail.gmail.com
Best regards,
Hou zj