AW: Database Name - case sensitivity

From: "William Sescu (Suva)" <william(dot)sescu(at)suva(dot)ch>
To: "pgsql-admin(at)lists(dot)postgresql(dot)org" <pgsql-admin(at)lists(dot)postgresql(dot)org>
Cc: Edwin UY <edwin(dot)uy(at)gmail(dot)com>
Subject: AW: Database Name - case sensitivity
Date: 2025-01-21 11:11:13
Message-ID: GV0P278MB02441BA6A34EB7F487F898E8E8E62@GV0P278MB0244.CHEP278.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Alter database rename should do the job ..

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

(postgres(at)[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(at)[local]:58888)[postgres]> ALTER DATABASE "TestForBlah" RENAME TO test;
ALTER DATABASE

(postgres(at)[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 <edwin(dot)uy(at)gmail(dot)com>
Gesendet: Dienstag, 21. Januar 2025 12:01
An: pgsql-admin(at)lists(dot)postgresql(dot)org
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.

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message msalais 2025-01-21 14:48:04 Commit with wait event on advisory lock!
Previous Message Guillaume Lelarge 2025-01-21 11:09:58 Re: Database Name - case sensitivity