RE: Column Filtering in Logical Replication

From: "houzj(dot)fnst(at)fujitsu(dot)com" <houzj(dot)fnst(at)fujitsu(dot)com>
To: Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>
Cc: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>, Rahila Syed <rahilasyed90(at)gmail(dot)com>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, Peter Smith <smithpb2250(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: RE: Column Filtering in Logical Replication
Date: 2021-09-17 05:08:36
Message-ID: OS0PR01MB57166C0E07D626BA8F9E846F94DD9@OS0PR01MB5716.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thurs, Sep 16, 2021 10:37 PM Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-09-17 05:23:09 Re: relation OID in ReorderBufferToastReplace error message
Previous Message Amit Kapila 2021-09-17 05:05:27 Re: Logical replication keepalive flood