Unit testing framework for PostgreSQL

pgTAP is a suite of database functions that make it easy to write
TAP-emitting unit tests in psql scripts suitable for harvesting,
analysis, and reporting by a TAP harness, such as those used in Perl
and PHP applications.
TAP is the Test Anything Protocol (http://testanything.org/).