One note when using this for form validation. If you have a multi-column unique index Phoenix will show the error for the field defined first in the constraint in the schema definition. This has tripped me up a couple of times for user input where the constraint is something like tag+post_id. If your form just has the tag input and you put post_id as the first item in the constraint the changeset will be invalid but no error will show.