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

[YSQL] DROP DATABASE Not Supported #717

Closed
nocaway opened this issue Jan 8, 2019 · 4 comments
Closed

[YSQL] DROP DATABASE Not Supported #717

nocaway opened this issue Jan 8, 2019 · 4 comments
Assignees
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature
Projects

Comments

@nocaway
Copy link
Contributor

nocaway commented Jan 8, 2019

DROP DATABASE requires a cascading operation that is dropping all objects of that dropped database.
YugaByte is not yet supporting CASCADE operator.

@nocaway nocaway added the kind/enhancement This is an enhancement of an existing feature label Jan 8, 2019
@nocaway nocaway added this to To do in YSQL via automation Jan 8, 2019
@ravimurthy ravimurthy assigned nocaway and unassigned ravimurthy Feb 20, 2019
@mbautin
Copy link
Collaborator

mbautin commented Mar 20, 2019

Now that #969 is done, what is left to do to implement this?
Cc @nocaway @fizaaluthra

@fizaaluthra
Copy link
Contributor

For a DROP DATABASE command, postgres removes all tablespace subdirectories that belong to the database (see remove_dbtablespaces() in dbcommands.c). The database objects (tables, indexes etc) aren't explicitly dropped.
In YB mode we'll probably have to explicitly delete the database objects too.

@mbautin
Copy link
Collaborator

mbautin commented Mar 20, 2019

@fizaaluthra just to double-check, is that the behavior even with CASCADE enabled?

@fizaaluthra
Copy link
Contributor

@mbautin yes, even with CASCADE enabled

@ndeodhar ndeodhar added the area/ysql Yugabyte SQL (YSQL) label Apr 3, 2019
@ndeodhar ndeodhar moved this from To do to In progress in YSQL May 15, 2019
yugabyte-ci pushed a commit that referenced this issue May 25, 2019
Summary:
This diff provides support for DROP DATABASE.
- Database and all of its object would be dropped asynchronously.
- All other connections to the database will be terminated when they execute a statement after a drop.

Test Plan: Add TestPgDropDatabase

Reviewers: mihnea

Reviewed By: mihnea

Subscribers: yql

Differential Revision: https://phabricator.dev.yugabyte.com/D6663
@ndeodhar ndeodhar moved this from In progress to Done in YSQL May 29, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/ysql Yugabyte SQL (YSQL) kind/enhancement This is an enhancement of an existing feature
Projects
YSQL
  
Done
Development

No branches or pull requests

5 participants