- All Courses
- PostgreSQL for Developers
- Schema Design
- Constraints, keys, and integrity
Constraints, keys, and integrity
Constraints are guarantees the database keeps even when a buggy deploy does not. Foreign keys, uniqueness, and checks belong in the schema.
- 4m
- Intermediate

Video by CockroachDB · YouTube
Check your understanding
3 questions. Unlocks when you finish the video.
Overview
What this lesson covers
- Enforce relationships with foreign keys
- Use unique and check constraints as invariants
- Choose delete behaviour deliberately
This lesson sits in Schema Design, part of PostgreSQL for Developers. It assumes what came before it and leads directly into the next lesson in the module.
In this lesson you will:
- Enforce relationships with foreign keys
- Use unique and check constraints as invariants
- Choose delete behaviour deliberately
Resources
Your notes will live here
Note taking is not available yet. Nothing you type would be saved, so the tab stays read-only for now.