Update more queries for pgsql.