Обсуждение: Renaming database

Поиск
Список
Период
Сортировка

Renaming database

От
Patrick Robin
Дата:
What is the best way to rename a database in Postgres 6.5.

Will moving the unix directory work?

Thanks

Patrick Robin

--
________________________________________
Patrick Robin
patrickr@fa.disney.com
Walt Disney Feature Animation
500 South Buena Vista Street
Burbank,California 91521-4817




Re: Renaming database

От
Sevo Stille
Дата:
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