David Fetter: Assertions -- PGCon 2018
Channel: PGCon
Date: 2018-11-07

ASSERTIONs are a way to make very generalized constraints in a database. They were first described in SQL-92, and are only now coming to the fore. ASSERTIONs can be used for constraints like, "The sum of dice in the first_winning_roll table must be either 7 or 11," but that's just the beginning. ASSERTIONs can also constrain the state of multiple inter-related tables, as in "Any given payment_id can be in exactly one table among payment_check, payment_credit, and payment_manila," or even, "The sum of amounts across of type check, credit_card, and manila_envelope_stuffed_with_notes tables for a given payment_id must be the same as the amount in the payment table to which they refer."

Learn what's been done, what's happening, and what they hold for the future.

https://www.pgcon.org/2018/