I've modified the pg driver to remove most of the debug output. Now you will only get one copy of the query with bind vars substituted, and that will only happen if the db handle is in verbose mode. I'm assuming that the QD will output the query before bind variable substitution.