I'm trying to rename a DB in pgAdmin 4. But I this get error: ERROR: current database cannot be renamed.
What's the process for renaming a database in pgAdmin (the docs are USELESS)? And google can't provide a solution.
I'm trying to rename a DB in pgAdmin 4. But I this get error: ERROR: current database cannot be renamed.
What's the process for renaming a database in pgAdmin (the docs are USELESS)? And google can't provide a solution.
Using pgAdmin 4,
1) switch to the dashboard view
2) select the database to be renamed, right-click it and select Disconnect Database
3) Again select the database to be renamed, right-click it and select properties
4) change the name of the database in the Database field -click save
right click on db name and Properties, then change the name and click Save:
Or just click on other db (eg postgres), open query tool and run
alter database "old" rename to "new";
You are probably trying to rename the database you are connected to. Switch to a different db and then execute the ALTER command.