We'll start setting up pgunit for PostgreSQL using the following steps:
- The SQL script to set up PGUnit is found here: https://github.com/danblack/pgunit-sql/blob/master/sql/reinstall.sql. Please open the preceding link in your browser. You will see the script shown in Figure 11.5:
Figure 11.5 – PGUnit installation script
- The reinstall.sql installation script calls to execute another install.sql file and in turn, the install.sql script calls to many other scrips, such as assert_array_equals.sp.sql, assert_equals.sp.sql, and assert_false.sp.sql, but we are not using psql as these scripts are intending:
Figure 11.6 – The inner install.sql script
- Because we are using pgAdmin for the AWS PostgreSQL RDS and we are not using psql command-line scripts, we have to comment out \o and \echo for command-line psql command usages and then we have to copy thee sub-files' scripts to replace in the reinstall...