changed from mysql to pgsql