O'Reilly logo

PostgreSQL Cookbook by Chitij Chauhan

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 how to install PL/Proxy.

How to do it...

Perform the following sequence of steps to perform horizontal partitioning using PL/Proxy:

  1. Create three new databases, that is one proxy database named nodes and two partitioned databases named nodes_0000 and nodes_0001, respectively:
    postgres=# create database nodes;
    postgres=# create database nodes_0000;
    postgres=# create database nodes_0001;
  2. Once you've created these databases, the next step is to create a plproxy extension:
    psql  -d  nodes
    nodes=# create extension plproxy;
  3. The next step is to create ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required