How to include excluded rows in RETURNING from INSERT … ON CONFLICT
The error you get: ON CONFLICT DO UPDATE command cannot affect row a second time … indicates you are trying to upsert the same row more than once in a single command. In other words: you have dupes on (name, url, email) in your VALUES list. Fold duplicates (if that’s an option) and the error … Read more