Skip to content

How to use UNLESS CONFLICT in this query #2907

Answered by clmnin
clmnin asked this question in Q&A
Discussion options

You must be logged in to vote

I've used

constraint exclusive on ( (.company, .name, .sku) );

But the property .sku is not required. Which means when .sku is null (empty set) even if .company and .name are duplicated it won't raise an exception.

property sku -> str;

I believe this is the same for postgres.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@elprans
Comment options

@limx0
Comment options

@limx0
Comment options

@elprans
Comment options

@limx0
Comment options

Answer selected by clmnin
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants