mirror of
https://github.com/postgres/postgres.git
synced 2025-10-25 13:17:41 +03:00
Support deferrable uniqueness constraints.
The current implementation fires an AFTER ROW trigger for each tuple that looks like it might be non-unique according to the index contents at the time of insertion. This works well as long as there aren't many conflicts, but won't scale to massive unique-key reassignments. Improving that case is a TODO item. Dean Rasheed
This commit is contained in:
@@ -22,4 +22,5 @@ FROM pg_class c LEFT JOIN pg_namespace n ON n.oid = relnamespace
|
||||
WHERE relhasoids
|
||||
AND ((nspname ~ '^pg_') IS NOT FALSE)
|
||||
AND NOT EXISTS (SELECT 1 FROM pg_index i WHERE indrelid = c.oid
|
||||
AND indkey[0] = -2 AND indnatts = 1 AND indisunique);
|
||||
AND indkey[0] = -2 AND indnatts = 1
|
||||
AND indisunique AND indimmediate);
|
||||
|
||||
Reference in New Issue
Block a user