Fix quoting of PostgreSQL password in exec

This is a little tricky since single quotes cannot be escaped within a single quoted string, but I have now found a solution.