added postgresql support
Merge pull request #5 from andrepl/master

Adds support for Postgresql 9.1+