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

db execute: confusing error message when doing DROP DATABASE "test-doesnotexists;" says that Database postgres.public does not exist #11673

Closed
Jolg42 opened this issue Feb 7, 2022 · 0 comments · Fixed by prisma/prisma-engines#2831
Assignees
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines Issue for tech Engines. topic: error topic: prisma db execute CLI: prisma db execute
Milestone

Comments

@Jolg42
Copy link
Member

Jolg42 commented Feb 7, 2022

Given this schema and command

datasource my_db {
  provider = "postgresql"
  url      = "postgres://prisma:prisma@localhost:5432"
}
 echo "DROP DATABASE \"test-doesnotexists\";" | npx prisma@dev db execute --stdin --preview-feature --schema prisma/schema.prisma

I expected to get a SQL error message but instead got the following

Error: P1003

Database `postgres.public` does not exist on the database server at `localhost:5432`.

Note that doing the following works and returns Script executed successfully.
echo "CREATE DATABASE "test12344";" | npx prisma@dev db execute --stdin --preview-feature --schema prisma/schema.prisma

@Jolg42 Jolg42 added bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. kind/bug A reported bug. process/candidate topic: error team/schema Issue for team Schema. topic: prisma db execute CLI: prisma db execute labels Feb 7, 2022
@Jolg42 Jolg42 changed the title db execute: confusing error message when doing DROP DATABASE "test-doesnotexists;" says that Database postgres.public does not exist db execute: confusing error message when doing DROP DATABASE "test-doesnotexists;" says that Database postgres.public does not exist Feb 7, 2022
@pantharshit00 pantharshit00 added bug/2-confirmed Bug has been reproduced and confirmed. and removed bug/1-unconfirmed Bug should have enough information for reproduction, but confirmation has not happened yet. labels Feb 7, 2022
@Jolg42 Jolg42 added this to the 3.12.0 milestone Mar 16, 2022
@janpio janpio added the tech/engines Issue for tech Engines. label Mar 24, 2022
@tomhoule tomhoule assigned tomhoule and unassigned do4gr Apr 7, 2022
tomhoule added a commit to prisma/prisma-engines that referenced this issue Apr 7, 2022
tomhoule added a commit to prisma/prisma-engines that referenced this issue Apr 8, 2022
tomhoule added a commit to prisma/prisma-engines that referenced this issue Apr 8, 2022
@Jolg42 Jolg42 modified the milestones: 3.12.0, 3.13.0 Apr 11, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug/2-confirmed Bug has been reproduced and confirmed. kind/bug A reported bug. team/schema Issue for team Schema. tech/engines Issue for tech Engines. topic: error topic: prisma db execute CLI: prisma db execute
Projects
None yet
Development

Successfully merging a pull request may close this issue.

6 participants