2 ms·
Use before insert/update triggers? Which can do such queries and either fail or ignore if such row is found.
by rini17 2y ago
Use before insert/update triggers? Which can do such queries and either fail or ignore if such row is found.
- prmph 2y agoThanks for the suggestion, but I'd really like to avoid triggers if at all possible. I dislike triggers a lot for various practical and philosophical reasons
- rini17 2y agoYou will likely end up with convoluted INSERT OR IGNORE INTO... WITH ...SELECT statement with WITH clause which first detects existing pairwise matching rows and if they are found, the SELECT generates values which purposedly violate some other unique constraint. If that's practically or philosophically more acceptable to you :)