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

bug: 'cascade' and 'restrict' are not handled by drop view #9045

Closed
neverchanje opened this issue Apr 7, 2023 · 3 comments
Closed

bug: 'cascade' and 'restrict' are not handled by drop view #9045

neverchanje opened this issue Apr 7, 2023 · 3 comments
Assignees
Labels
type/bug Something isn't working
Milestone

Comments

@neverchanje
Copy link
Contributor

neverchanje commented Apr 7, 2023

Describe the bug

No response

To Reproduce

dev=> create table t ();
CREATE_TABLE
dev=> create view v as select * from t;
CREATE_VIEW
dev=> drop view if exists v cascade;
DROP_VIEW
dev=> \dt
               List of relations
   Schema   |       Name       | Type  | Owner
------------+------------------+-------+-------
 public     | t                | table | root
 rw_catalog | rw_ddl_progress  | table | root
 rw_catalog | rw_meta_snapshot | table | root
(3 rows)

When I specify 'cascade' when dropping 'v', the table 't' still exists.

dev=> drop view if exists v restrict;
DROP_VIEW

Same for restrict.

Expected behavior

Disallow these two keywords or handle them. The latter is preferable.

Additional context

No response

@neverchanje neverchanje added the type/bug Something isn't working label Apr 7, 2023
@github-actions github-actions bot added this to the release-0.19 milestone Apr 7, 2023
@TennyZhuang TennyZhuang self-assigned this May 19, 2023
@BugenZhao
Copy link
Member

Agree that we should at least report "unimplemented" instead of silently ignoring that.

@chenzl25
Copy link
Contributor

I tried to optimize our DBT adapter recently and found that Drop cascade is crucial to the user experience, otherwise it would fail to run dbt run the second time. I think we should support it.

@yezizp2012
Copy link
Contributor

Done by #11250 .

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type/bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants