213 reputation
125
bio website
location
age
visits member for 3 years, 4 months
seen Sep 7 at 17:53

Oct
13
awarded  Yearling
Aug
20
awarded  Famous Question
Aug
5
awarded  Nice Question
Mar
9
awarded  Notable Question
Sep
27
awarded  Popular Question
Dec
28
awarded  Supporter
Dec
28
comment PostgreSQL multi-column unique constraint and NULL values
In my case NULL is really NULL (id_C is a foreign key to table_c for exemple so it can't have -1 value), it means their is no relationship between "my_table" and "table_c". So it has a functional signification. By the way [(1, 1,1,null), (2, 1,2,null), (3,2,4,null)] is a valid list of inserted data.
Dec
27
awarded  Scholar
Dec
27
comment PostgreSQL multi-column unique constraint and NULL values
I can confirm that the partial index is working very well :) I'm actually not dba on my projet but I will tramsit advices to relevant people.
Dec
27
accepted PostgreSQL multi-column unique constraint and NULL values
Dec
27
awarded  Student
Dec
27
comment PostgreSQL multi-column unique constraint and NULL values
A and B can't be null but C can be null or any positive integer value. So (1,2,3) and (2,4,null) are valid but (null,2,3) or (1,null,4) are invalid. And [(1,2,null), (1,2,3)] does not break unique constraint but [(1,2, null), (1,2,null)] must break it.
Dec
27
comment PostgreSQL multi-column unique constraint and NULL values
my mistake, question edited. id_C stand for an optionnal relation to another table (foreign key).
Dec
27
asked PostgreSQL multi-column unique constraint and NULL values