Partitioning with PL/Proxy
In this recipe, we are going to cover horizontal partitioning with PL/Proxy.
Getting ready
PL/Proxy needs to be installed on the host machine. Refer to the previous recipe for more details on installing PL/Proxy.
How to do it...
The following are the steps that need to be carried out for horizontal partitioning using PL/Proxy:
Create three new databases: one proxy database named nodes, and two partitioned databases,
nodes_0000
andnodes_0001
, respectively:postgres=# create database nodes; postgres=# create database nodes_0000; postgres=# create database nodes_0001;
Once you have created these databases the next step is to create a PL/Proxy extension:
psql -d nodes nodes=# create extension plproxy;
The next step is to create the
plproxy
schema in the proxy database nodes:nodes=# create schema plproxy;
The next step is to execute the following mentioned file,
plproxy...