Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bug in the description of the UNIQUE constraint in the Constraints section #22

Open
alfonso-higuera opened this issue Dec 27, 2024 · 0 comments

Comments

@alfonso-higuera
Copy link

In the Constraints section the following is stated:

UNIQUE is another constraint that dictates that this column must be unqiue amongst all other columns

I don't think this is accurate, or at least I feel this is easy to misinterpret. According to section 5.4.3. Unique Constraints of the PostgreSQL (version 14) manual

Unique constraints ensure that the data contained in a column, or a group of columns, is unique among all the rows in the table

So, to my understanding, the UNIQUE constraint does not constraint a column (or group of columns) relative to "all the other columns" but instead it constraint the values that a column (or group or columns) can have relative to the values in that column for all the rows in the table.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant