Update console query for pgsql.