Fix database sync for postgresql

It appears I missed this in the original pull request (#17). Hopefully should also work fine with MySQL :wink: