Re: Error in ALTER DATABASE command - Mailing list pgsql-general

From Steve Crawford
Subject Re: Error in ALTER DATABASE command
Date
Msg-id 48D9127E.4060402@pinpointresearch.com
Whole thread Raw
In response to Error in ALTER DATABASE command  (William Garrison <postgres@mobydisk.com>)
List pgsql-general
William Garrison wrote:
> In Postgresql 8.2.9 on Windows, you cannot rename a database if the
> name contains mixed case.
>
> To replicate:
> 1) Open the pgadmin tool.
> 2) Create a database named "MixedCase" (using the UI, not using a
> query window or using PSQL)
> 3) Open a query window, or use PSQL to issue the following command
>    ALTER DATABASE MixedCase RENAME TO anything_else;
> PostgreSQL will respond with:
>    ERROR: database "mixedcase" does not exist
>    SQL state: 3D000
Did you try:
ALTER DATABASE "MixedCase"....?

Note the use of double-quotes around the name. I don't have any Windows
machines to try this with but it appears you just need to add the
double-quotes to prevent PostgreSQL from folding to lower-case.

Cheers,
Steve


pgsql-general by date:

Previous
From: Raymond O'Donnell
Date:
Subject: Re: Error in ALTER DATABASE command
Next
From: William Garrison
Date:
Subject: pg_dump | pg_sql: insert commands and foreign key constraints