How can I allow NULL in a UNIQUE column in PostgreSQL? This is a misunderstanding The UNIQUE constraint does exactly what you want NULL values can coexist in multiple rows in a column defined UNIQUE The manual: In general, a unique constraint is violated when there is more than one row in the table where the values of all of the columns included in the constraint are equal However, two null values are not considered equal in this comparison