Databases · Middle · Question 22 of 75

What does INSERT ... ON CONFLICT (email) DO UPDATE do?

Explanation

It's safe under concurrency, unlike 'select, then insert or update'. DO NOTHING simply skips duplicates. The conflict target needs a unique index.

Further reading

Problem with a question

Databases · Middle · question 22

Test yourself

Take the Databases · Middle quiz: questions and options are shuffled, and you get a review of your mistakes at the end.

Take this quiz