Log statement params at %r, not %s.
Bug fix: fix SQL flavour for upgrade.