0

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;
                           ^
Pulath Yaseen
  • 395
  • 1
  • 3
  • 14

1 Answers1

3

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.

dassum
  • 4,727
  • 2
  • 25
  • 38