Change more queries for pgsql.