If the broken query is one generated by the driver you probably cannot, you would need to file a bug report. I strongly doubt your lack of current-ness on the PostgreSQL is going to be an influence here but maybe...
In any case you are going to need something much more descriptive, and ideally executable than this, if you actually want to debug and then file a bug report (or fix your code if that is where the problem originates).