Re: Drop Database - Mailing list pgsql-novice

From Tom Lane
Subject Re: Drop Database
Date
Msg-id 440.1042993052@sss.pgh.pa.us
Whole thread Raw
In response to Drop Database  (Forest W Felling <res08i7v@verizon.net>)
List pgsql-novice
Forest W Felling <res08i7v@verizon.net> writes:
> I can not find an explanation to help me understand why
> mydb=# drop database November;
> fails, while
> [Forest-Fellings-Computer:~] dropdb -i -e November
> succeeds.

In the SQL command, you need
    drop database "November";
See the User's Guide's discussion of identifiers, particularly
case-folding and quoting.

Our command-line tools generally double-quote whatever they find
on their command lines, so that what dropdb sent to the server
was in fact DROP DATABASE "November".  This makes their behavior a
little inconsistent compared to raw SQL, but the other way proved
too unwieldy because of shell quoting rules.  If dropdb did not supply
double quotes then you'd have had to type something like
    dropdb '"November"'
which is awfully tedious.

            regards, tom lane

pgsql-novice by date:

Previous
From: Forest Felling
Date:
Subject: Drop Database
Next
From: "Le Mar Davidson"
Date:
Subject: Initial Postgresql password