BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;
{{~#each tables}}
{{~#if this.filter}}
    \copy (
        SELECT {{this.columns}}
        FROM "{{this.name}}"
        WHERE {{this.filter}}
    ) TO 'data/{{this.name}}.csv' WITH CSV HEADER
{{~else}}
    \copy "{{this.name}}" ({{this.columns}}) TO 'data/{{this.name}}.csv' WITH CSV HEADER
{{~/if}}
{{~/each}}
COMMIT;

BEGIN ISOLATION LEVEL REPEATABLE READ, READ ONLY;
{{~#each tables}}
{{~#if this.filter}}
    \copy (
        SELECT {{this.columns}}
        FROM "{{this.name}}"
        WHERE {{this.filter}}
    ) TO 'data/{{this.name}}.csv' WITH CSV HEADER
{{~else}}
    \copy "{{this.name}}" ({{this.columns}}) TO 'data/{{this.name}}.csv' WITH CSV HEADER
{{~/if}}
{{~/each}}
COMMIT;

Change dump_db isolation level to "REPEATABLE READ"
Change dump_db isolation level to "REPEATABLE READ"

This addresses the following error:

```
sql_error_code = 0A000 ERROR:  cannot use serializable mode in a hot standby
sql_error_code = 0A000 HINT:  You can use REPEATABLE READ instead.
sql_error_code = 0A000 STATEMENT:  BEGIN ISOLATION LEVEL SERIALIZABLE READ ONLY DEFERRABLE;

```

Because our application does not rely on any other `SERIALIZABLE`
transactions, it should be fine to relax the isoluation level for
database dumps to `REPEATABLE READ`.

`DEFERRABLE` is dropped because it is only meaningful when combined
with `SERIALIZABLE`.
