dolthub / doltgresql

DoltgreSQL - Version Controlled PostgreSQL
Apache License 2.0
1.07k stars 23 forks source link

Support adding unique constraints through `ALTER TABLE` #800

Open fulghum opened 3 days ago

fulghum commented 3 days ago

Doltgres supports adding a unique constraint via a primary key, but returns the following error for a non-primary key uniqueness constraint: Only PRIMARY KEY constraints are supported currently

The spot where we're missing logic is: https://github.com/dolthub/doltgresql/blob/a2b63abb73671ada155ae3dc4d18c2d50f83f23a/server/ast/constraint_table_def.go#L63

Discovered through HarukaMa data dump loading.