RE: row filtering for logical replication - Mailing list pgsql-hackers

From houzj.fnst@fujitsu.com
Subject RE: row filtering for logical replication
Date
Msg-id OS0PR01MB571696CA853B3655F7DE752994E29@OS0PR01MB5716.jpnprd01.prod.outlook.com
Whole thread Raw
In response to Re: row filtering for logical replication  ("Euler Taveira" <euler@eulerto.com>)
List pgsql-hackers
Hi,

I am interested in this feature and took a quick a look at the patch.
Here are a few comments.

(1)
+                appendStringInfo(&cmd, "%s", q);

We'd better use appendStringInfoString(&cmd, q);


(2)
+    whereclause = transformWhereClause(pstate,
+                                       copyObject(pri->whereClause),
+                                       EXPR_KIND_PUBLICATION_WHERE,
+                                       "PUBLICATION");
+
+    /* Fix up collation information */
+    assign_expr_collations(pstate, whereclause);

Is it better to invoke eval_const_expressions or canonicalize_qual here to
simplify the expression ?


(3)
+                appendPQExpBuffer(&buf,
+                                  ", pg_get_expr(pr.prqual, c.oid)");
+            else
+                appendPQExpBuffer(&buf,
+                                  ", NULL");

we'd better use appendPQExpBufferStr instead of appendPQExpBuffer here.

(4)
nodeTag(expr) == T_FuncCall)

It might looks clearer to use IsA(expr, FuncCall) here.

Best regards,
Houzj

pgsql-hackers by date:

Previous
From: Tom Lane
Date:
Subject: Re: O_DIRECT on macOS
Next
From: Arne Roland
Date:
Subject: Re: Rename of triggers for partitioned tables