PgTAP tests for 0824

As promised at the August 2013 dev meeting, I'll be adding PgTAP tests
for any database work that I create, and where possible for any that
I commit for others.

Signed-off-by: Mike Rylander <mrylander@gmail.com>