Update some queries for pg.