Subject: Database Name - case sensitivity

From: Edwin UY <[email-masked]>
Date: Wed, 22 Jan 2025 00:01:22 +1300

Hi,

Is there any way to rename a database?
I have some databases that are in upper case and some that are a mix of
upper and lower case and I want to rename them all as lowercase.
For example, I have a TEST and a TestforBlah for example. These are just
sample names.

---

From: Guillaume Lelarge <[email-masked]>
Date: Tue, 21 Jan 2025 12:09:58 +0100

Hi,

> For example, I have a TEST and a TestforBlah for example. These are just

You need to use double quotes. For example:

ALTER DATABASE "TestforBlah" RENAME TO testforblah;

Regards.

-- 
Guillaume.

---

From: "William Sescu (Suva)" <[email-masked]>
Date: Tue, 21 Jan 2025 11:11:13 +0000

Alter database rename should do the job ..

(postgres@[local]:58888)[postgres]> create database "TestForBlah";
CREATE DATABASE

(postgres@[local]:58888)[postgres]> \l "TestForBlah"
                                 List of databases
    Name     |  Owner   | Encoding |   Collate   |    Ctype    | Access privileges
-------------+----------+----------+-------------+-------------+-------------------
TestForBlah | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(1 row)

(postgres@[local]:58888)[postgres]> ALTER DATABASE "TestForBlah" RENAME TO test;
ALTER DATABASE

(postgres@[local]:58888)[postgres]> \l test
                             List of databases
Name |  Owner   | Encoding |   Collate   |    Ctype    | Access privileges
------+----------+----------+-------------+-------------+-------------------
test | postgres | UTF8     | en_US.UTF-8 | en_US.UTF-8 |
(1 row)

Von: Edwin UY <[email-masked]>
Gesendet: Dienstag, 21. Januar 2025 12:01
An: [email-masked]
Betreff: Database Name - case sensitivity

  ACHTUNG: Diese Nachricht kommt von extern. Seien Sie kritisch beim Öffnen von Links und Anhängen.

Hi,

Is there any way to rename a database?
I have some databases that are in upper case and some that are a mix of upper and lower case and I want to rename them all as lowercase.
For example, I have a TEST and a TestforBlah for example. These are just sample names.

________________________________

Disclaimer:

Diese Nachricht und ihr eventuell angehängte Dateien sind nur für den Adressaten bestimmt. Sie kann vertrauliche oder gesetzlich geschützte Daten oder Informationen beinhalten. Falls Sie diese Nachricht irrtümlich erreicht hat, bitten wir Sie höflich, diese unter Ausschluss jeglicher Reproduktion zu löschen und die absendende Person zu benachrichtigen. Danke für Ihre Hilfe.

This message and any attached files are for the sole use of the recipient named above. It may contain confidential or legally protected data or information. If you have received this message in error, please delete it without making any copies whatsoever and notify the sender. Thank you for your assistance.