Skip to main content

Is CASCADE keyword always needed?

  • June 20, 2018
  • 1 reply
  • 2 views

Bryan_H
Forum|alt.badge.img+2

I have a prospect testing 9.1.0-1 from AWS marketplace who complains that to DROP a column or table, they always have to specify CASCADE, even if it's a new table with only superprojection. I wouldn't expect to need CASCADE when the superprojection is the only dependency, and they say it is a bit unsafe to always specify CASCADE in DROP DDL's. Has DROP become more pedantic in recent releases?

1 reply

DaveT
Forum|alt.badge.img
  • Participating Frequently
  • June 20, 2018

If they drop without CASCADE they should get information as to why the DROP was not allowed. I think any column included in sorting or segmenting would prevent dropping. I think DROP TABLE (without CASCADE) won't be allowed unless the one and only projection was created as part of CREATE TABLE.

The drop without cascade is helping them if they are concerned about being unsafe and losing information they do not want to lose. Even CASCADE won't let them drop a column if it is a column that impacts the only (super) projection.