Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumSQLupserts ON CONFLICT MERGESingle-choice MCQ

You run an upsert with ON CONFLICT (id) DO NOTHING followed by RETURNING id. A conflicting row already exists, so no insert and no update happen. What does the statement return?

INSERT INTO users (id, email) VALUES (7, 'a@x.com') ON CONFLICT (id) DO NOTHING RETURNING id;