How to do it...

Follow these steps to test as the postgres database user. Feel free to substitute where appropriate:

  1. Connect to the primary database and create a test table with the following SQL:
        CREATE TABLE foo (bar INTEGER); 
  1. Connect to pgpool and issue a query that will write to the test table with the following SQL:
        INSERT INTO foo SELECT generate_series(1, 100); 
  1. Execute the following bash snippet at the command line to test the INSERT redirection:
        for x in {1..10}; do 
          psql -h 192.168.56.10 -p 9999 \ 
               -U postgres -d postgres \ 
               -c "INSERT INTO foo SELECT generate_series(1, 100)" 
        done 
  1. Execute the following bash snippet at the command line to test the DELETE redirection:
 for x in {1..100}; do psql -h 192.168.56.10 -p 9999 ...

Get PostgreSQL High Availability Cookbook - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.