Ensure unique values through a table constraint.
Section: Indexes and Constraints
Add unique constraint
sql
sql
ALTER TABLE public.users ADD CONSTRAINT users_email_key UNIQUE (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