DEV Community

eddiejpot
eddiejpot

Posted on

3 2

PostgreSQL: Drop a database that has a hyphen in the name

Normally to drop a database in psql (postgresql) , we can just type

DROP DATABASE dbname;
Enter fullscreen mode Exit fullscreen mode

If we want to drop a database called "db-name". we have to escape the database name which contains the hyphen by using double quotation marks.

DROP DATABASE "db-name";
Enter fullscreen mode Exit fullscreen mode

Resource link here here

Top comments (0)

Heroku

Build apps, not infrastructure.

Dealing with servers, hardware, and infrastructure can take up your valuable time. Discover the benefits of Heroku, the PaaS of choice for developers since 2007.

Visit Site

👋 Kindness is contagious

Please leave a ❤️ or a friendly comment on this post if you found it helpful!

Okay