Re: rename - Mailing list pgsql-general

From Neil Conway
Subject Re: rename
Date
Msg-id 1038415144.1806.46.camel@tokyo
Whole thread Raw
In response to rename  (Ken Guest <kguest@stockbyte.com>)
List pgsql-general
On Wed, 2002-11-27 at 09:29, Ken Guest wrote:
> Guys,
> Is it possible to rename databases, and what's the syntax I should
> use?

Well, it's *possible* -- you can manually update the system catalogs,
like so:

UPDATE pg_database SET datname = 'newname' WHERE datname = 'oldname';
VACUUM FULL pg_database;

(The VACUUM is required as pg_database is not MVCC-aware).

However, this is not recommended operating procedure, if it destroys all
your data I won't take any responsibility :-) A safer route would be to
pg_dump the database and restore it with a different name.

Cheers,

Neil
--
Neil Conway <neilc@samurai.com> || PGP Key ID: DB3C29FC




pgsql-general by date:

Previous
From: Jean-Christian Imbeault
Date:
Subject: Re: Create Timestamp From Date and Time
Next
From: Tom Lane
Date:
Subject: Re: Integrity constraint [false] problem