AI Features

Solution Review: Testing in PostgreSQL

See a detailed analysis of the solution to the "Testing in SQL" challenge.

We'll cover the following...

Here is the solution for the challenge of writing a test script for unit testing and running your test using pg_prove.

Solution

The tests are written in the respective files. The table required for the challenge is already created for you.

Use the following command to run the tests:

su - postgres -c 'pg_prove -h 0.0.0.0 -d "mydb" -U "postgres" /usercode/tests/*.sql'

Click the “Run” button in the following ...

Ask