ALTER TABLE .. DROP UNIQUE
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
A UNIQUE constraint can be dropped from the table using the ALTER TABLE's DROP UNIQUE clause:
// Drop specific types of constraints
create.alterTable("table").dropUnique("uk").execute();
Dialect support
This example using jOOQ:
alterTable("t").dropUnique("c")
Translates to the following dialect specific expressions:
ASE, Access, Aurora MySQL, Aurora Postgres, DB2, Firebird, H2, HSQLDB, Hana, Informix, MariaDB, MySQL, Oracle, Postgres, Redshift, SQLDataWarehouse, SQLServer, Snowflake, Sybase, Teradata, Vertica, YugabyteDB
ALTER TABLE t DROP CONSTRAINT c
CockroachDB
DROP INDEX c CASCADE
BigQuery, ClickHouse, Databricks, DuckDB, Exasol, MemSQL, SQLite, Spanner, Trino
/* UNSUPPORTED */
Generated with jOOQ 3.21. Support in older jOOQ versions may differ. Translate your own SQL on our website
Feedback
Do you have any feedback about this page? We'd love to hear it!