Pulath Yaseen
Pulath Yaseen

Reputation: 415

cannot drop database in postgres using terminal

I created a database with the name "femme-myp " in postgres. There was no problem while creation or while using tables in python Django. but when i try to drop the database in terminal it says there is an error in the name and it points at the "-" in the name.Is there any way I can drop that database?

ERROR:  syntax error at or near "-"
LINE 1: DROP DATABASE femme-myp;
                           ^

Upvotes: 0

Views: 211

Answers (1)

dassum
dassum

Reputation: 5103

try with quotes in the database name:

DROP DATABASE "femme-myp";

All identifiers that don't start with a letter and contain characters other than letters, digits and the underscore _ must be quoted.

Upvotes: 3

Related Questions