Skip to content

Commit

Permalink
Merge pull request #2570 from bjornasm/multiple-primary-keys
Browse files Browse the repository at this point in the history
Update constraints.md - removed duplicate of example
  • Loading branch information
szarnyasg authored Mar 22, 2024
2 parents e382c6e + 4d45195 commit f250acb
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions docs/sql/constraints.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,13 +49,6 @@ INSERT INTO students VALUES (1, 'Student 2');
INSERT INTO students VALUES (1, 'Student 1');
-- Constraint Error: Duplicate key "id: 1, name: Student 1" violates primary key constraint
```
```sql
CREATE TABLE students (id INTEGER, name VARCHAR, PRIMARY KEY (id, name));
INSERT INTO students VALUES (1, 'Student 1');
INSERT INTO students VALUES (1, 'Student 2');
INSERT INTO students VALUES (1, 'Student 1');
-- Constraint Error: Duplicate key "id: 1, name: Student 1" violates primary key constraint
```

In order to enforce this property efficiently, an [ART index is automatically created](indexes) for every primary key or unique constraint that is defined in the table.

Expand Down

0 comments on commit f250acb

Please sign in to comment.