Database Reference
In-Depth Information
END IF;
END;
$$ LANGUAGE plpgsql;
The last function needed is plproxy.get_cluster_config , which enables you
to configure the behavior of PL/Proxy. This sample will set the connection lifetime to
10 minutes:
CREATE OR REPLACE FUNCTION
plproxy.get_cluster_config(
in cluster_name text,
out key text,
out val text)
RETURNS SETOF record AS $$
BEGIN
-- lets use same config for all clusters
key := 'connection_lifetime';
val := 10*60;
RETURN NEXT;
RETURN;
END;
$$ LANGUAGE plpgsql;
Configuring PL/Proxy cluster using SQL/MED
Since version 8.4, PostgreSQL has support for an SQL standard for management
of external data, usually referred to as SQL/MED. SQL/MED is simply a standard
way to access data that resides outside the database. Using functions to configure
partitions is arguably insecure, as any caller of
plproxy.get_cluster_partitions() can learn connection strings for parti-
tions that may contain sensitive info like passwords. PL/Proxy also provides a way
to do the cluster configuration using SQL/MED, which follows the standard SQL se-
curity practices.
The same configuration as discussed earlier, when done using SQL/MED is as fol-
lows:
Search WWH ::




Custom Search