Replace all database mysql-functions with postgresql-functions