After some attempts to resolve this issue, I must admit that we should
add a non-trivial method in the CustomScan node interface, which would
be called in the ruleutils code.
I guess it is too much for such a rare situation. So maybe just add a
documentation entry on this thing and set a couple of assertions on
early detection of problems?.
In the attachment - is an offer on how to change the code.
--
regards,
Andrey Lepikhov
Postgres Professional