tweaking postgresql support, fixing error reporting