Re: postgres_fdw: Handle boolean comparison predicates

Поиск
Список
Период
Сортировка
От Ashutosh Bapat
Тема Re: postgres_fdw: Handle boolean comparison predicates
Дата
Msg-id CAExHW5tFOphpmHebhGjPxKh3JNyspBwfmK9p=ovrC3D0TPFu2A@mail.gmail.com
обсуждение исходный текст
Ответ на postgres_fdw: Handle boolean comparison predicates  (Emre Hasegeli <emre@hasegeli.com>)
Ответы Re: postgres_fdw: Handle boolean comparison predicates  (Emre Hasegeli <emre@hasegeli.com>)
Список pgsql-hackers
Hi Emre,
This looks like a good improvement.

Please add this patch to the commitfest so that it's not forgotten. It
will be considered as a new feature so will be considered for commit
after the next commitfest.

Mean time here are some comments.
+/*
+ * Deparse IS [NOT] TRUE/FALSE/UNKNOWN expression.
+ */
+static void
+deparseBooleanTest(BooleanTest *node, deparse_expr_cxt *context)
+{
+    StringInfo    buf = context->buf;
+
+    switch (node->booltesttype)
+    {

+        case IS_NOT_TRUE:
+            appendStringInfoString(buf, "(NOT ");
+            deparseExpr(node->arg, context);
+            appendStringInfoString(buf, " OR ");
+            deparseExpr(node->arg, context);
+            appendStringInfoString(buf, " IS NULL)");
+            break;

+}

I don't understand why we need to complicate the expressions when
sending those to the foreign nodes. Why do we want to send (xyz IS
FALSE) (NOT (xyz) OR (xyz IS NULL)) and not as just (xyz IS FALSE).
The latter is much more readable and less error-prone. That true for
all the BooleanTest deparsing.

+EXPLAIN (VERBOSE, COSTS OFF) SELECT * FROM ft1 t1 WHERE (c1 = 100) IS
TRUE;            -- BooleanTest

Also test a boolean column?

On Mon, May 31, 2021 at 1:33 PM Emre Hasegeli <emre@hasegeli.com> wrote:
>
> The comparison predicates IS [NOT] TRUE/FALSE/UNKNOWN were not
> recognised by postgres_fdw, so they were not pushed down to the remote
> server.  The attached patch adds support for them.
>
> I am adding this to the commitfest 2021-07.



-- 
Best Wishes,
Ashutosh Bapat



В списке pgsql-hackers по дате отправления:

Предыдущее
От: Amit Kapila
Дата:
Сообщение: Re: Skipping logical replication transactions on subscriber side
Следующее
От: Michael Paquier
Дата:
Сообщение: Re: Incorrect snapshots while promoting hot standby node when 2PC is used