partial postgres support

It still doesn't work completely but this gets it partway there. Fixes the bools, the date formats and (pet peeve) puts it all into a transaction so you don't get duplicates if it fails in the middle for some reason. This is probably postgres-specific due to the E'' strings. (There is a better way to do it, but I'm having trouble chasing down the exact error right now.)