Skip to content

How to setup unique constraint with soft delete enabled #7799

Discussion options

You must be logged in to vote

Hey @jdinartejesus,

If you are using postgres 15 or newer you can use new constraint UNIQUE NULLS NOT DISTINCT. If not than it is possible only via workaround like not using null.

More on stackoverflow question.

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@talgat-ruby
Comment options

Answer selected by talgat-ruby
@jdinartejesus
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
2 participants