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: (view raw, whole thread or download thread mbox)
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


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-2017 The PostgreSQL Global Development Group