PostgreSQL constraint, that gets checked on commit and not earlier [duplicate]
问题 This question already has answers here : Constraint defined DEFERRABLE INITIALLY IMMEDIATE is still DEFERRED? (2 answers) Closed last year . Is it possible to create to create a unique index or other kind of constraint in PostgreSQL, that would be checked on transaction COMMIT and not a millisecond earlier? I need an index for a pair of (record_id, ordering), so I make sure that inside a given record_id only one and no more than one records has the same ordering. Where's the problem? Well,