Reader small image

You're reading from  Developing Modern Database Applications with PostgreSQL

Product typeBook
Published inAug 2021
PublisherPackt
ISBN-139781838648145
Edition1st Edition
Right arrow
Authors (2):
Dr. Quan Ha Le
Dr. Quan Ha Le
author image
Dr. Quan Ha Le

Dr. Quan Ha Le graduated with a Ph.D. in computer science from the Queen's University of Belfast, United Kingdom, in 2005. Since his Ph.D. graduation, he has been working as a PostgreSQL database administrator all over Alberta and Ontario, Canada, until now. From 2008 to 2019, Dr. Le Quan Ha administered, designed, and developed 24 small, medium, large, and huge PostgreSQL databases in Canada. Since 2016, after writing a good publication on PostgreSQL database clusters on clouds, he has been a member of the United States PostgreSQL Association (PgUS) in New York City. Dr. Le Quan Ha has also been a board member of the PgUS Diversity committee since 2018.
Read more about Dr. Quan Ha Le

Marcelo Diaz
Marcelo Diaz
author image
Marcelo Diaz

Marcelo Diaz is a software engineer with more than 15 years of experience, with a special focus on PostgreSQL. He is passionate about open source software and has promoted its application in critical and high-demand environments where he has worked as a software developer and consultant for both private and public companies. He currently works very happily at Cybertec and as a technical reviewer for Packt Publishing. He enjoys spending his leisure time with his daughter, Malvina, and his wife, Romina. He also likes playing football.
Read more about Marcelo Diaz

View More author details
Right arrow

Setting up simple pgunit for PostgreSQL RDS

  1. 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;
  1. You should run the PGUnit.sql code using pgAdmin: https://github.com/adrianandrei-ca/pgunit/blob/master/PGUnit.sql.
  1. We will copy the code from GitHub:

Figure 11.10  Simple pgunit installation script
  1. 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.

  1. Thereafter, please execute the whole of the script together in pgAdmin.
  1. The result of a simple pgunit should be as follows: 

Figure 11.11 – Completion of the simple pgunit installation

Here is a list...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Developing Modern Database Applications with PostgreSQL
Published in: Aug 2021Publisher: PacktISBN-13: 9781838648145

Authors (2)

author image
Dr. Quan Ha Le

Dr. Quan Ha Le graduated with a Ph.D. in computer science from the Queen's University of Belfast, United Kingdom, in 2005. Since his Ph.D. graduation, he has been working as a PostgreSQL database administrator all over Alberta and Ontario, Canada, until now. From 2008 to 2019, Dr. Le Quan Ha administered, designed, and developed 24 small, medium, large, and huge PostgreSQL databases in Canada. Since 2016, after writing a good publication on PostgreSQL database clusters on clouds, he has been a member of the United States PostgreSQL Association (PgUS) in New York City. Dr. Le Quan Ha has also been a board member of the PgUS Diversity committee since 2018.
Read more about Dr. Quan Ha Le

author image
Marcelo Diaz

Marcelo Diaz is a software engineer with more than 15 years of experience, with a special focus on PostgreSQL. He is passionate about open source software and has promoted its application in critical and high-demand environments where he has worked as a software developer and consultant for both private and public companies. He currently works very happily at Cybertec and as a technical reviewer for Packt Publishing. He enjoys spending his leisure time with his daughter, Malvina, and his wife, Romina. He also likes playing football.
Read more about Marcelo Diaz