using pg2_wrapper instead of pgQuery