Debugging to solve pg_result errors.