how to rename a database in postgresql Oct
12
1
1

http://www.postgresonline.com/journal/archives/40-How-do-you-rename-a-database.html

First kick the users out of the database, you can find the users with the following command.

SELECT * 
    FROM pg_stat_activity 
    WHERE datname = 'myolddbname_goes_here'

now run the following:

ALTER DATABASE myolddbname_here RENAME TO mynewdbname_here
Bookmark and Share
blog comments powered by Disqus