Merge pull request #2788 from pyhalov/postgresql