Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support DROP TABLE CASCADE #19498

Open
damian3031 opened this issue Oct 23, 2023 · 3 comments
Open

Support DROP TABLE CASCADE #19498

damian3031 opened this issue Oct 23, 2023 · 3 comments
Labels
enhancement New feature or request

Comments

@damian3031
Copy link
Member

Support DROP TABLE table_name CASCADE to automatically drop objects that depend on the table (such as views), and in turn all objects that depend on those objects.

@findinpath
Copy link
Contributor

cc @martint

@sahoss
Copy link
Contributor

sahoss commented Oct 25, 2023

I am interested in contributing to this issue @damian3031. given this is a non-trivial fix, would a design summary shared on this issue be a good way to get started?

@hashhar
Copy link
Member

hashhar commented Oct 25, 2023

@sahoss yes, it's also worth to consider what the SQL spec says about this.

For example since Trino doesn't have contraints but underlying data sources might should a DROP TABLE table CASCADE also drop any references to columns from the dropped table from other tables?
If yes how do we detect them in a way that's consistent across connectors?

IMO personally this doesn't make too much sense unless we can define the problem being solved more concretely.
e.g. Do we want to be able to find and drop all dependent views only? Do we want to be able to do that for views created from external systems? What's the use-case we're trying to solve for.

cc: @martint

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Development

No branches or pull requests

4 participants