Some change for Postgres/mysql incompatability