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

cherry-pick 1.1: sql: revert the default behavior of DROP DATABASE to CASCADE #19209

Merged
merged 1 commit into from Oct 19, 2017

Conversation

knz
Copy link
Contributor

@knz knz commented Oct 12, 2017

Cherry-pick of #19182.

... because that's what DROP DATABASE does in postgres, and schema
migration tools expect it to work this way.

However, in order to avoid unpleasant surprises by user, make
DROP DATABASE without behavior specifier also error out
when the session variable sql_safe_updates is set. This is
the case e.g. in interactive shells by default. For example:

root@:26257/> drop database t;
pq: rejected: DROP DATABASE on non-empty database without explicit CASCADE (sql_safe_updates = true)

cc @cockroachdb/release

... because that's what DROP DATABASE does in postgres, and schema
migration tools expect it to work this way.

However, in order to avoid unpleasant surprises by user, make
DROP DATABASE *without* behavior specifier also error out
when the session variable `sql_safe_updates` is set. This is
the case e.g. in interactive shells by default. For example:

```
root@:26257/> drop database t;
pq: rejected: DROP DATABASE on non-empty database without explicit CASCADE (sql_safe_updates = true)
```
@knz knz requested review from jordanlewis and a team October 12, 2017 09:53
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@knz knz merged commit 6f7ad84 into cockroachdb:release-1.1 Oct 19, 2017
@knz knz deleted the 20171012-cherrypick-19182 branch October 19, 2017 08:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants