Enforce uniqueness with an index.
Section: Indexes and Constraints
Create unique index
sql
sql
CREATE UNIQUE INDEX idx_users_email_unique ON public.users (email);Explanation
See summary for usage details.
Learn the surrounding workflow
Compare similar commands or jump into common fixes when this command is part of a bigger troubleshooting path.
Related commands
Same sheet · prioritizing Indexes and Constraints