pgsql8 diffing fix: code refactoring for mysql5 needs done everywhere