- The plpgsql code depends on the dblink extension being present in the database you run the tests on. We set up a simple pgunit in a dedicated schema such as pgunit and run these two lines of SQL:
CREATE SCHEMA pgunit;
CREATE EXTENSION DBLINK SCHEMA pgunit;
- You should run the PGUnit.sql code using pgAdmin: https://github.com/adrianandrei-ca/pgunit/blob/master/PGUnit.sql.
- We will copy the code from GitHub:
Figure 11.10 – Simple pgunit installation script
- A convenient way to install the simple pgunit suite in our dedicated pgunit schema is to temporarily change the search path like this:
SET search_path TO pgunit;
We then revert search_path back to the public schema after the GitHub script.
- Thereafter, please execute the whole of the script together in pgAdmin.
- The result of a simple pgunit should be as follows:
Figure 11.11 – Completion of the simple pgunit installation
Here is a list...