Feeds and imports contain both new rows and changes to rows you already have. An upsert handles both in one statement:
INSERT INTO products (product_id, name, category, price, cost, units_in_stock)
VALUES (4, 'French Press', 'Kitchen', 34.00, 12.75, 0)
ON CONFLICT (product_id) DO UPDATE SET price = EXCLUDED.price;
If the key already exists, the row is updated instead of failing. EXCLUDED refers to the row you tried to insert. DO NOTHING skips existing keys. This syntax works in PostgreSQL, SQLite and here; MySQL writes ON DUPLICATE KEY UPDATE.
MERGE is the SQL standard form, used by SQL Server, Oracle, Snowflake, BigQuery and PostgreSQL 15 and later:
MERGE INTO products AS p USING stock_count AS s ON p.product_id = s.product_id
WHEN MATCHED THEN UPDATE SET units_in_stock = s.counted
WHEN NOT MATCHED THEN INSERT (...) VALUES (...);
Both need a key to match on; ON CONFLICT also needs a primary key or unique constraint on it.