Re: Renaming database - Mailing list pgsql-general

From Sevo Stille
Subject Re: Renaming database
Date
Msg-id 399D4319.1E69848C@ip23.net
Whole thread Raw
In response to Renaming database  (Patrick Robin <Patrick.Robin@disney.com>)
List pgsql-general
Patrick Robin wrote:
>
> What is the best way to rename a database in Postgres 6.5.

The only documented way is dump and restore.

> Will moving the unix directory work?

No. Moving the directory and updating datname and datpath in pg_database
will. Caveat: In that, you'll inevitably have some period where your
configuration is hosed. Less likely to go wrong would be keeping the old
directory name and only updating datname. YMMV - live surgery on
databases can be useful in emergencies, but it has risks. The only
guaranteed safe procedure is dump and restore!

Sevo

--
sevo@ip23.net

pgsql-general by date:

Previous
From: Thomas Lockhart
Date:
Subject: Re: [HACKERS] [Fwd: Optimization in C]
Next
From: "Grembowicz, Kenneth"
Date:
Subject: VERY SLOW UPDATES