Update PVDatabase.php

Replacing pg_exec with pg_query because of pg_exec removale