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

fix(dbmanager): use correct SQL to drop databases #3640

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

scottt
Copy link

@scottt scottt commented Oct 8, 2024

Before this patch, ManagedClient.CreateDatabase could issue the following SQL:

DROP DATABASE mydb IF EXISTS WITH (FORCE)

which is not standard SQL and does not work with PostgreSQL. See https://www.postgresql.org/docs/current/sql-dropdatabase.html

This patch fixes to code to issue:

DROP DATABASE IF EXISTS mydb WITH (FORCE)

@kyleconroy , this patch fixes the DROP DATABASE syntax error introduced in #3525 and #3421

Previously the code used:

```
DROP DATABASE mydb IF EXISTS WITH (FORCE)
```

which is not standard SQL and does not work with PostgreSQL.

This patch fixes to code to issue:

```
DROP DATABASE IF EXISTS mydb WITH (FORCE)
```
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.

1 participant