Support for postgresql

I think it was the last request using 'end' missing the postgresql support.
Merge pull request #466 from Crystark/patch-1

Support for postgresql