piggy: changes to use postgres instead of psql lite.