Upsert
INSERT ... ON CONFLICT handles a duplicate key in the same statement. DO UPDATE can read the rejected row as EXCLUDED.
task
A product with sku 'TENT-9' may already exist. Insert it (product_id 999, name 'Test', category 'tents', price 9900) or, if the sku exists, only set its price_cents to 9900.