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)

Image of Stellar post

Check out Episode 1: How a Hackathon Project Became a Web3 Startup πŸš€

Ever wondered what it takes to build a web3 startup from scratch? In the Stellar Dev Diaries series, we follow the journey of a team of developers building on the Stellar Network as they go from hackathon win to getting funded and launching on mainnet.

Read more

πŸ‘‹ Kindness is contagious

Engage with a wealth of insights in this thoughtful article, valued within the supportive DEV Community. Coders of every background are welcome to join in and add to our collective wisdom.

A sincere "thank you" often brightens someone’s day. Share your gratitude in the comments below!

On DEV, the act of sharing knowledge eases our journey and fortifies our community ties. Found value in this? A quick thank you to the author can make a significant impact.

Okay