Available in versions: Dev (3.21) | Latest (3.20) | 3.19 | 3.18 | 3.17 | 3.16 | 3.15 | 3.14 | 3.13 | 3.12 | 3.11
ALTER TABLE .. DROP COLUMN CASCADE
Supported by ✅ Open Source Edition ✅ Express Edition ✅ Professional Edition ✅ Enterprise Edition
An optional CASCADE clause can be added to a DROP COLUMN clause to cascade the DROP operatoin to dependent objects.
// Add a CASCADE clause when dropping columns
create.alterTable("table").drop("column").cascade().execute();
Note: Implementations do not agree on what dependent objects are included in the CASCADE operation.
Dialect support
This example using jOOQ:
alterTable("t").drop("c").cascade()
Translates to the following dialect specific expressions:
CockroachDB, DB2, HSQLDB, Postgres, Redshift, YugabyteDB
ALTER TABLE t DROP c CASCADE
Oracle
ALTER TABLE t DROP COLUMN c CASCADE CONSTRAINTS
ASE, Access, Aurora MySQL, Aurora Postgres, BigQuery, ClickHouse, Databricks, DuckDB, Exasol, Firebird, H2, Hana, Informix, MariaDB, MemSQL, MySQL, SQLDataWarehouse, SQLServer, SQLite, Snowflake, Spanner, Sybase, Teradata, Trino, Vertica
/* 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!