Thread: How to rename current database?

How to rename current database?

From
Sven Delle
Date:
I’m baffled that I have to sign up for a mailing list because I’m absolutely unable to figure out from the interface of
pgAdmin4 how to rename a given database? 

I’m going to the properties of the database to rename it, but get an error: ERROR: current database cannot be renamed.

Hmm, I guess it’s because it’s currently running, fine – I get that. But then, HOW THE HOLY CRAP DO I STOP THE DATABASE
SOI CAN RENAME IT!?!?!?!?!?!?!?!!?!!?!? 

Horrible experience from a user perspective.

How do I rename a current database in pgAdmin?

The docs are useless ...

Re: How to rename current database?

From
Steven Crandell
Date:

On Wed, May 9, 2018 at 12:24 AM, Sven Delle <svdellepude@gmail.com> wrote:
I’m baffled that I have to sign up for a mailing list because I’m absolutely unable to figure out from the interface of pgAdmin 4 how to rename a given database?

I’m going to the properties of the database to rename it, but get an error: ERROR: current database cannot be renamed.

Hmm, I guess it’s because it’s currently running, fine – I get that. But then, HOW THE HOLY CRAP DO I STOP THE DATABASE SO I CAN RENAME IT!?!?!?!?!?!?!?!!?!!?!?

Horrible experience from a user perspective.

How do I rename a current database in pgAdmin?

The docs are useless ...


Here's a link to the documentation that describes how to rename a database.
I think you'll find that it has all the information you're looking for.
That said, if you feel something is missing you can propose changes or additions to help make the documentation better.

Keep in mind that pgadmin is a tool that can be used when interacting with a postgresql database, it is by no means required to perform database administration tasks.
Personally, I prefer psql, which is also well documented here:

You may have better luck with your pgadmin questions on the pgadmin mailing list here:




Re: How to rename current database?

From
Walter Nordmann
Date:
iirc, you "goto" any other database and from there you may rename what 
you want.

Regards

walter


Am 09.05.2018 um 09:24 schrieb Sven Delle:
> I’m baffled that I have to sign up for a mailing list because I’m absolutely unable to figure out from the interface
ofpgAdmin 4 how to rename a given database?
 
>
> I’m going to the properties of the database to rename it, but get an error: ERROR: current database cannot be
renamed.
>
> Hmm, I guess it’s because it’s currently running, fine – I get that. But then, HOW THE HOLY CRAP DO I STOP THE
DATABASESO I CAN RENAME IT!?!?!?!?!?!?!?!!?!!?!?
 
>
> Horrible experience from a user perspective.
>
> How do I rename a current database in pgAdmin?
>
> The docs are useless ...



Re: How to rename current database?

From
Scott Whitney
Date:

Hang on. You're baffled that you have to sign up for a mailing list on which experts reside because you lack the expertise to do something?


I mean, you can't figure it out on your own, so you're offended and baffled that you have to come to a community of people with enough good will and time on their hands to offer you free advice on resolving your problem?


That's not the kind of attitude that's going to garner you a whole heckuva lot of help.


Cheers.



From: Steven Crandell <steven.crandell@gmail.com>
Sent: Wednesday, May 9, 2018 3:09 AM
To: Sven Delle
Cc: pgsql-admin@lists.postgresql.org
Subject: Re: How to rename current database?
 

On Wed, May 9, 2018 at 12:24 AM, Sven Delle <svdellepude@gmail.com> wrote:
I’m baffled that I have to sign up for a mailing list because I’m absolutely unable to figure out from the interface of pgAdmin 4 how to rename a given database?

I’m going to the properties of the database to rename it, but get an error: ERROR: current database cannot be renamed.

Hmm, I guess it’s because it’s currently running, fine – I get that. But then, HOW THE HOLY CRAP DO I STOP THE DATABASE SO I CAN RENAME IT!?!?!?!?!?!?!?!!?!!?!?

Horrible experience from a user perspective.

How do I rename a current database in pgAdmin?

The docs are useless ...


Here's a link to the documentation that describes how to rename a database.
I think you'll find that it has all the information you're looking for.
That said, if you feel something is missing you can propose changes or additions to help make the documentation better.

Keep in mind that pgadmin is a tool that can be used when interacting with a postgresql database, it is by no means required to perform database administration tasks.
Personally, I prefer psql, which is also well documented here:

You may have better luck with your pgadmin questions on the pgadmin mailing list here:






Journyx, Inc.
7600 Burnet Road #300
Austin, TX 78757
www.journyx.com

p 512.834.8888 
f 512-834-8858 

Do you receive our promotional emails? Click here or visit http://journyx.com/communication-preferences to unsubscribe.

Re: How to rename current database?

From
Alvaro Herrera
Date:
Sven Delle wrote:

> I’m going to the properties of the database to rename it, but get an
> error: ERROR: current database cannot be renamed.
> 
> Hmm, I guess it’s because it’s currently running, fine – I get that.
> But then, HOW THE HOLY CRAP DO I STOP THE DATABASE SO I CAN RENAME
> IT!?!?!?!?!?!?!?!!?!!?!?

A PostgreSQL server (or "service") hosts multiple databases, and any one
session is connected to one database.  What the message is saying is
that you can't rename the database you're connected to -- it is *not*
that you have to stop the server.  In Postgres terminology, databases
cannot be "stopped"; servers can.

This applies to pgadmin just like to any other program you use to
connect to a database.

-- 
Álvaro Herrera                https://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services


Re: How to rename current database?

From
"David G. Johnston"
Date:
On Wed, May 9, 2018 at 5:14 AM, Scott Whitney <scott@journyx.com> wrote:

Hang on. You're baffled that you have to sign up for a mailing list on which experts reside because you lack the expertise to do something?


​The OP is baffled by an instance poor UX ​- for something that seems like it should be simple.  I respect that.


How do I rename a current database in pgAdmin?

The docs are useless ...

Here's a link to the documentation that describes how to rename a database.
I think you'll find that it has all the information you're looking for.
That said, if you feel something is missing you can propose changes or additions to help make the documentation better.

Keep in mind that pgadmin is a tool that can be used when interacting with a postgresql database, it is by no means required to perform database administration tasks.
Personally, I prefer psql, which is also well documented here:

​While both of these are technically correct the complaint is about pgAdmin usability and functionality.  And using ALTER DATABASE when connected to the target database is going to fail in the same way that pgAdmin fails.​

You may have better luck with your pgadmin questions on the pgadmin mailing list here:

​Correct.​

I don't use pgAdmin, but either in pgAdmin or psql I would connect to the "postgres" database (which exists by default) as the "postgres" user and run:

"ALTER DATABASE not_postgres_database RENAME TO new_database_name";​

Figuring out how to do that in pgAdmin will likely require assistance on their mailing list - I see nothing of note in their docs.

David J.