You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
INSERT INTO products ("key", "name")
VALUES ('1234', 'Product name')
ON CONFLICT ("key")
DO UPDATE
SET name = EXCLUDED.name
WHERE products.name IS NULL
AND EXCLUDED.name IS NOT NULL
RETURNING "key", "name";
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
Let's consider this example:
Our query:
Execute our query (first execution).
Query return result:
Now execute our query again (second execution and each next).
Query result:
So, if the query executed correctly but did not take action on any row by excluding
WHERE clause
, shouldn't it be handled in some way?If so, in what way? Return error ? Handle
RowsAffected
like inUpdate
method?Beta Was this translation helpful? Give feedback.
All reactions