improved postgres support
Merge pull request #743 from wenshao/master

improved postgres support
improved postgresql support
Merge pull request #744 from wenshao/master

improved postgresql support