News for hackers. Stuff that matters.
Re:Postgres 15 improves UNIQUE and NULL by radiospiel on Monday July 11, 2022 @05:50PM (#32062441)
You might want to look at a unique partial index: "CREATE UNIQUE INDEX foo ON users(facebook_id) WHERE facebook_id IS NOT NULL".

I am not sure if this really is a great modelling. If a user happens to have two logins in your table (maybe they signed up with two different emails), and then connects one of his accounts with his FB identity, what does it mean that the other entry cannot be connected to the FB identity?

There are no comments on this comment yet.