Connect string is taken from function result or directly from argument.
If several functions have same connstr, they will use same connection.
+_(New in 2.0.9)_
-NB: giving untrusted users ability to specify full connect string creates
+*NB*: giving untrusted users ability to specify full connect string creates
security hole. Eg it can used to read cleartext passwords from `~/.pgpass`
or `pg_service.conf`. If such function cannot be avoided, it's access rights
need to be restricted.
RUN ON argname; RUN ON $1;
-Take hash value directly from function argument.
+Take hash value directly from function argument. _(New in 2.0.8)_
== SPLIT ==
This is done by evaluating RUN ON condition for each array element and building
per-partition parameter arrays for each matching partition. During execution
each tagged partition then gets its own subset of the array to process.
+_(New in 2.1)_
The semantics of RUN ON statement is slightly changed with SPLIT arrays:
PL/Proxy supports function returning plain RECORD type. Such functions
need the result type specified at call site. Main use-case is to run
-random queries on partitions. Very simple example:
+random queries on partitions. _(New in 2.0.6)_
+
+Very simple example:
CREATE OR REPLACE FUNCTION dynamic_query(q text)
RETURNS SETOF RECORD AS $$
* Drop plproxy.get_cluster_config()...
- * Dynamic connstr loading for CONNECT functions?
* RUN ON ALL: sort by?
* RUN ON ALL: ignore errors?
* RUN ON ANY: if one con failed, try another