Advertisement
Guest User

Untitled

a guest
May 6th, 2015
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.80 KB | None | 0 0
  1. - <para>
  2. - <command>INSERT</command> with an <literal>ON CONFLICT DO UPDATE</>
  3. - clause is a <quote>deterministic</quote> statement. This means
  4. - that the command will not be allowed to affect any single existing
  5. - row more than once; a cardinality violation error will be raised
  6. - when this situation arises. Rows proposed for insertion should not
  7. - duplicate each other in terms of attributes constrained by the
  8. - conflict-arbitrating unique index. Note that the ordinary rules
  9. - for unique indexes (and exclusion constraints) with regard to null
  10. - apply analogously to whether or not an arbitrating index indicates
  11. - if the alternative path should be taken. This means that when a
  12. - null value appears in any constrained tuple's column in an
  13. - <command>INSERT</command> statement with <literal>ON
  14. - CONFLICT</literal>, rows proposed for insertion will never take the
  15. - alternative path (provided that the column appears in the
  16. - arbitrating index's definition, and provided that a <literal>BEFORE
  17. - ROW INSERT</literal> trigger does not make null values non-null
  18. - before insertion); the statement will always insert, assuming
  19. - there is no unrelated error. Note that merely locking a row with
  20. - <literal>ON CONFLICT DO UPDATE</> (and not updating due to the row
  21. - not satisfying the <literal>WHERE</> clause
  22. - <replaceable>condition</>) does not count towards whether or not
  23. - the row has been affected multiple times (and whether or not a
  24. - cardinality violation error is raised). However, the
  25. - implementation checks for cardinality violations after locking the
  26. - row, and before <emphasis>considering</emphasis> updating, so a
  27. - cardinality violation may be raised despite the fact that the row
  28. - would not otherwise have gone on to be updated.
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement