Re: Renaming a database

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: Renaming a database
Дата
Msg-id 15049.1025543650@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Renaming a database  (Florian Weimer <Weimer@CERT.Uni-Stuttgart.DE>)
Список pgsql-admin
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



В списке pgsql-admin по дате отправления:

Предыдущее
От: Florian Weimer
Дата:
Сообщение: Renaming a database
Следующее
От: Tim Ellis
Дата:
Сообщение: Re: tedia2sql 0.77 (Dia-->SQL DDL Tool) Released