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
Views: Raw Message | Whole Thread | Download mbox | Resend email
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

Browse pgsql-general by date

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