Skip to content

duplicate-primary-key-column (CT005)#

Automatic fix is available.

What it does#

Checks for duplicate column in primary key.

Why not?#

While PostgreSQL does not allow duplicate columns in a primary key constraint, such constructs are still parseable, but will error out at runtime.

Having a duplicate column in a primary key is an obvious error.

When should you?#

Never.

Use instead:#

Remove duplicate column from the primary key constraint.