Fix upgrade to work with Postgresql, too
Merge pull request #15 from brki/fix-27-postgresql-upgrade

Merged into master branch - thanks for providing the fix