From: Tom Lane <tgl@sss.pgh.pa.us>
To: Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>
Cc: pgsql-admin@postgresql.org
Subject: Re: Renaming a database
Date: Mon, 01 Jul 2002 13:14:10 -0400
Message-ID: <15049.1025543650@sss.pgh.pa.us> (raw)
In-Reply-To: <871yancv5k.fsf@CERT.Uni-Stuttgart.DE>
References: <871yancv5k.fsf@CERT.Uni-Stuttgart.DE>
Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE> writes:
> Is there a way to rename an existing database, short of dumping and
> restoring it?
In 7.1 or later a quick UPDATE on pg_database.datname should do it,
I believe.
It might be a bad idea to do it while there are any connections to
the target database --- I know that backends remember the name of the
DB they are connected to, but I forget whether it's actually used for
anything significant.
Also, vacuuming pg_database after committing the UPDATE might be
necessary, depending on just which version you are running.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-admin@postgresql.org
Cc: tgl@sss.pgh.pa.us, Weimer@CERT.Uni-Stuttgart.DE
Subject: Re: Renaming a database
In-Reply-To: <15049.1025543650@sss.pgh.pa.us>
References: <871yancv5k.fsf@CERT.Uni-Stuttgart.DE> <15049.1025543650@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox