Skip to content

Conversation

scottt
Copy link
Contributor

@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) ```
@kyleconroy kyleconroy added the bug Something isn't working label Oct 9, 2024
@kyleconroy
Copy link
Collaborator

Thank you!

@kyleconroy kyleconroy merged commit 695d9a1 into sqlc-dev:main Oct 9, 2024
7 of 8 checks passed
alfonsodev pushed a commit to ExponentiaTeam/sqlc that referenced this pull request Oct 13, 2025
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

bug Something isn't working

2 participants