Re: Change the name of the database

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Chris Mair <list(at)1006(dot)org>
Cc: Sylvain Brohée <sbrohee(at)ulb(dot)ac(dot)be>, pgsql-novice(at)postgresql(dot)org
Subject: Re: Change the name of the database
Date: 2005-01-17 15:42:53
Message-ID: 1913.1105976573@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Chris Mair <list(at)1006(dot)org> 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

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Jaime Casanova 2005-01-17 22:08:28 Re: Updating views : cannot figure out what goes wrong
Previous Message Sean Davis 2005-01-17 13:58:02 Re: Sql query as input variable in a PL/pgsql function?