Emmanuel Medernach <medernac@clermont.in2p3.fr> writes:
> So the problem is that is calls the UDF on the FDW node (Foreign
> Scan on master_object_000 + Filter) and not on the remote server.
Right.
> - How to call the UDF on the remote server ?
postgres_fdw intentionally refuses to do this, because it has no way
to know whether q3c_radial_query() is the same function, or even
exists at all, on the remote server. Only WHERE clauses involving
built-in functions/operators will be pushed across to the remote server.
Barring solutions for that philosophical question, you might be able
to do something like putting the function call into a view on the remote
side and then creating a foreign table that references the view.
regards, tom lane