Any database wizards out there?
I have a table with an ID column. The ID column is unique together with a valid date, so the ID itself is not unique.
However, I also need a name column that is unique under the condition that any given name can only correspond to one specific ID (but not necessarily the other way around).
The database is PostgreSQL. Is it possible to formulate, for instance, a UNIQUE INDEX to achieve this?
Edit: Solved 🥳
#Programming #Development #Help #Database #PostgreSQL
@intrbiz The data model is what it is, and not under my control, so let's leave it at that 😅
But an EXCLUDE constraint seems to have solved the problem: https://mastodon.online/@veronica/114585025259682969