Re: How to rename current database? - Mailing list pgsql-admin

From Alvaro Herrera
Subject Re: How to rename current database?
Date
Msg-id 20180509130330.vu3gozt2mk7b6eb3@alvherre.pgsql
Whole thread Raw
In response to How to rename current database?  (Sven Delle <svdellepude@gmail.com>)
List pgsql-admin
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


pgsql-admin by date:

Previous
From: Scott Whitney
Date:
Subject: Re: How to rename current database?
Next
From: Alvaro Herrera
Date:
Subject: Re: How do I execute SQL in pgAdmin!?