I didn't read the code, but I hope it doesn't as this is very difficult to do correctly in all situations, for reasons I've tried to cover in lib/pq#233.