Update query for pgsql.