In order to successfully test the capabilities of pgpool, we will try a couple of different scenarios that cause PostgreSQL to write to the database. If we tried to write to the replica instead of the primary server, we will get an error like this:
ERROR: cannot execute INSERT in a read-only transaction
Our first step is to create a table where we can try to insert data. We connect directly to the primary server for this step so that we know the table exists and that pgpool didn't get a chance to taint our results. The test table has only one column, so we can populate it with the generate_series PostgreSQL function.
The first test we attempt is with a single connection to pgpool that we create manually. Since the server ...