 | | From: | Sylvain Brohée | | Subject: | Change the name of the database | | Date: | Mon, 17 Jan 2005 12:06:45 +0100 |
|
|
 | Could somebody help me? I'm trying to change the name of my psql database. Does it exist any command to do this.
Thanks a lot for your help,
Sylvain Brohée Free University of Brussels
---------------------------(end of broadcast)--------------------------- TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org
|
|
 | | From: | Andreas Kretschmer | | Subject: | Re: [despammed] Change the name of the database | | Date: | Mon, 17 Jan 2005 12:21:40 +0100 |
|
|
 | am 17.01.2005, um 12:06:45 +0100 mailte Sylvain Brohée folgendes: > Could somebody help me? > I'm trying to change the name of my psql database. > Does it exist any command to do this.
Create a dump, create the new db, and play the dump in the new db.
Andreas -- Andreas Kretschmer (Kontakt: siehe Header) Heynitz: 035242/47212, D1: 0160/7141639 GnuPG-ID 0x3FFF606C http://wwwkeys.de.pgp.net === Schollglas Unternehmensgruppe ===
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
|
 | | From: | Chris Mair | | Subject: | Re: Change the name of the database | | Date: | Mon, 17 Jan 2005 12:19:59 +0100 |
|
|
 | > Could somebody help me? > I'm trying to change the name of my psql database. > Does it exist any command to do this.
Sure, just issue this command:
alter database old_db_name rename to new_db_name;
Bye, Chris.
---------------------------(end of broadcast)--------------------------- TIP 3: if posting/reading through Usenet, please send an appropriate subscribe-nomail command to majordomo@postgresql.org so that your message can get through to the mailing list cleanly
|
|
 | | From: | Tom Lane | | Subject: | Re: Change the name of the database | | Date: | Mon, 17 Jan 2005 10:42:53 -0500 |
|
|
 | Chris Mair writes: >> I'm trying to change the name of my psql database. >> Does it exist any command to do this.
> just issue this command: > alter database old_db_name rename to new_db_name;
Note that this command exists only since PG 7.4. In earlier releases, you can fake it by executing a manual UPDATE on pg_database. (Beware that you need to do a CHECKPOINT afterware to be sure that newly connecting backends will see the updated name.)
regards, tom lane
---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend
|
|