Renaming a Database
Renaming a Database
Is it possible to rename a database?
[Former] HM Support
You can rename your database(s) with pgAdmin
I looked around in pgAdmin III and I couldn't find anywhere to rename it. It seems as if the names are locked in and unable to edit.
Try this:
Create a backup of your database with PGAdmin. Create a new database with the name that you want. Restore the old database on top of the database you just created.
(You may want to back up your DB before you try this, but it worked fine for me.)
Found the trick:
- Go into "PSQL to 'postgres'" (not pgAdmin)
- Enter this line exactly, but where xxx = old DB name and nnn = new DB name:
ALTER DATABASE "xxxxxxx" RENAME TO "nnnnnnn" \g
(Here's the PostgreSQL Doc page for it: http://www.postgresql.org/docs/8.3/s...rdatabase.html ) (the "\g" part is what executes the command)
- When you next open HEM, you will get an error "Database not found" or something. Click "OK" and Database Maintenance should open. Connect and make your newly named DB the default.
Then you're set!!
Last edited by Stick66; 10-21-2008 at 12:20 PM .
Reason: disclaimer at top
Posting Permissions
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
Forum Rules