Allow postgres_fdw to ship extension funcs/operators for remote execution.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Nov 2015 23:42:02 +0000 (18:42 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 3 Nov 2015 23:42:18 +0000 (18:42 -0500)
commitd89494166351e1fdac77d87c6af500401deb2422
treee52b846d65238f4de8515daed56b585467bde7cd
parentee44cb7566ffafc0144535e1f966f5e3bb7d384b
Allow postgres_fdw to ship extension funcs/operators for remote execution.

The user can whitelist specified extension(s) in the foreign server's
options, whereupon we will treat immutable functions and operators of those
extensions as candidates to be sent for remote execution.

Whitelisting an extension in this way basically promises that the extension
exists on the remote server and behaves compatibly with the local instance.
We have no way to prove that formally, so we have to rely on the user to
get it right.  But this seems like something that people can usually get
right in practice.

We might in future allow functions and operators to be whitelisted
individually, but extension granularity is a very convenient special case,
so it got done first.

The patch as-committed lacks any regression tests, which is unfortunate,
but introducing dependencies on other extensions for testing purposes
would break "make installcheck" scenarios, which is worse.  I have some
ideas about klugy ways around that, but it seems like material for a
separate patch.  For the moment, leave the problem open.

Paul Ramsey, hacked up a bit more by me
contrib/postgres_fdw/Makefile
contrib/postgres_fdw/deparse.c
contrib/postgres_fdw/option.c
contrib/postgres_fdw/postgres_fdw.c
contrib/postgres_fdw/postgres_fdw.h
contrib/postgres_fdw/shippable.c [new file with mode: 0644]
doc/src/sgml/postgres-fdw.sgml
src/backend/utils/adt/format_type.c
src/include/utils/builtins.h