Main idea is that proxy function will be created with same signature as remote function to be called, so only destination info needs to be specified inside proxy function body.
PostgreSQL must be installed for this to work.
The language is similar to plpgsql - string quoting, comments, semicolon at the statements end.
It contains only 4 statements: `CONNECT`, `CLUSTER`, `RUN` and `SELECT`.
Each function needs to have either `CONNECT` or pair of `CLUSTER` + `RUN` statements to specify where to run the function.
The `SELECT` statement is optional, if it is missing, there will be default query generated based on proxy function signature.
The `RUN` statment is also optional, it defaults to `RUN ON ANY` which means the query will be run random partition.
Here are some key features of "PL/Proxy":
· PL/Proxy functions detect remote functions to be called from their own signature.
· Function can be run on one, some or all members of the cluster.
· If query is executed on several partitions, it will happen in parallel.
· Queries are run in auto-commit mode on the remote server.
· Query parameters are sent separately from query body, thus avoiding quoting/unquoting overhead on both sides.
· If proxy and partition backend versions match, PL/Proxy tries to use binary I/O if possible.
· PL/Proxy launches connections into each part from each backend, so in heavy-duty environment is necessary to put pooler between PL/Proxy and partitions.
What's New in This Release: [ read full changelog ]
· Uses current_user instead session_user for authentication.