Skip site navigation (1) Skip section navigation (2)

Re: Is renaming a database easy or dangerous

From: "scott(dot)marlowe" <scott(dot)marlowe(at)ihs(dot)com>
To: Hadley Willan <hadley(dot)willan(at)deeperdesign(dot)co(dot)nz>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is renaming a database easy or dangerous
Date: 2003-02-27 15:59:51
Message-ID: Pine.LNX.4.33.0302270858500.18487-100000@css120.ihs.com (view raw or flat)
Thread:
Lists: pgsql-general
On 27 Feb 2003, Hadley Willan wrote:

> Hello,
>    I'd like to rename one of my databases. Is it is simple as changing
> the datname field in the pg_databases table?
> 
> If so, is it done through ALTER database or a SQL update? 

The way I do it is:

# createdb newdb
# pg_dump olddb|psql -e newdb 
... check to make sure it's all there working, then...
# dropdb olddb


In response to

Responses

pgsql-general by date

Next:From: Stephan SzaboDate: 2003-02-27 16:21:46
Subject: Re: index usage (and foreign keys/triggers)
Previous:From: Dave CramerDate: 2003-02-27 15:52:18
Subject: phpBB2 slow on postgres vs mysql ?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group