Hi.
postgres_fdw currently doesn't handle RowCompareExpr, which doesn't
allow keyset pagination queries to be efficiently executed over sharded
table.
Attached patch adds handling of RowCompareExpr in deparse.c, so that we
could push down conditions like
WHERE (created, id) > ('2023-01-01 00:00:00'::timestamp, 12345) to the
foreign server.
I'm not sure about conditions when it's possible for RowCompareExpr to
have opnos with different names or namespaces, but comment in
ruleutils.c suggests that this is possible, so I've added check for this
in foreign_expr_walker().
--
Best regards,
Alexander Pyhalov,
Postgres Professional