What is a good strategy for updating lot of rows in postgersql?
The usual way is to import the CSV file into a staging table. Either an unlogged table which you only create once, or a temp table which you  create immediately before the import.
Something along the lines:
create temp table inventory_import (item_id integer primary key, quantity integer);
copy inventory_import from '/path/to/file.csv' ... ;

update inventory i
  set quantity = im.quantity
from inventory_import im
where i.item_id = im.item_id;