Re: Cleaning up template 1 -> template0 cloning

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Cleaning up template 1 -> template0 cloning
Дата
Msg-id web-847066@davinci.ethosmedia.com
обсуждение исходный текст
Ответ на Re: Cleaning up template 1 -> template0 cloning  (Thomas Good <tomg@admin.nrnet.org>)
Ответы Re: Cleaning up template 1 -> template0 cloning  ("Josh Berkus" <josh@agliodbs.com>)
Re: Cleaning up template 1 -> template0 cloning  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql
Thomas, folks,

>      Note: template1 and template0 do not have any special status
>  beyond
>      the fact that the name template1 is the default source database
>      name for CREATE DATABASE and the default database-to-connect-to
>  for
>      various scripts such as createdb. For example, one could drop
>      template1 and recreate it from template0 without any ill
>  effects.
>      This course of action might be advisable if one has carelessly
>      added a bunch of junk in template1.

Help!  The above documentation seems to be incorrect.

If I try to connect to Template0:
psql: FATAL 1:  Database "template0" is not currently acceptingconnections

If I try to drop template1 from psql:
ERROR:  DROP DATABASE: database is marked as a template

If I try "dropdb template1":
ERROR:  DROP DATABASE: cannot be executed on the currently opendatabase
dropdb: database removal failed

Trying to remove template1 to restore it using an undamaged template0seems to be a catch-22 with no way out.  Help!

-Josh Berkus


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

Предыдущее
От: "Josh Berkus"
Дата:
Сообщение: Re: date manipulation
Следующее
От: "Josh Berkus"
Дата:
Сообщение: Re: Cleaning up template 1 -> template0 cloning