Re: documentation vs reality: template databases

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: documentation vs reality: template databases
Дата
Msg-id 200701201544.l0KFiM827409@momjian.us
обсуждение исходный текст
Ответ на documentation vs reality: template databases  ("Richard P. Welty" <rwelty@averillpark.net>)
Ответы Re: documentation vs reality: template databases  (Alvaro Herrera <alvherre@commandprompt.com>)
Список pgsql-general
Richard P. Welty wrote:
> running 8.1 on a fedora core 5 linux box, up to date so far as
> i know.
>
> this page:
>
> http://www.postgresql.org/docs/8.1/interactive/manage-ag-templatedbs.html
>
> says the following:
>
>     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. 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.
>
> having just carelessly loaded a backup into template1 instead of the
> place i wanted to load it, i had a chance to try to follow this advice:
>
> foo=# drop database template1;
> ERROR: cannnot drop a template database
> foo=#

The comment in the source code says:

    /*
     * Disallow dropping a DB that is marked istemplate.  This is just to
     * prevent people from accidentally dropping template0 or template1; they
     * can do so if they're really determined ...
     */

I have added a documentaiton mention that 'datistemplate' must be
changed to 'false' to allow deletion.  Backpatched to 8.2.X.

--
  Bruce Momjian   bruce@momjian.us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +
Index: doc/src/sgml/manage-ag.sgml
===================================================================
RCS file: /cvsroot/pgsql/doc/src/sgml/manage-ag.sgml,v
retrieving revision 2.49
diff -c -c -r2.49 manage-ag.sgml
*** doc/src/sgml/manage-ag.sgml    5 Nov 2006 22:42:07 -0000    2.49
--- doc/src/sgml/manage-ag.sgml    20 Jan 2007 15:37:09 -0000
***************
*** 257,263 ****
      For example, one could drop <literal>template1</> and recreate it from
      <literal>template0</> without any ill effects.  This course of action
      might be advisable if one has carelessly added a bunch of junk in
!     <literal>template1</>.
     </para>

     <para>
--- 257,264 ----
      For example, one could drop <literal>template1</> and recreate it from
      <literal>template0</> without any ill effects.  This course of action
      might be advisable if one has carelessly added a bunch of junk in
!     <literal>template1</>. (To delete <literal>template1</literal>,
!     it must have <literal>datistemplate = false</>.)
     </para>

     <para>

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

Предыдущее
От: "Mikael Carneholm"
Дата:
Сообщение: Re: Help : Microsoft SQL Server equivalents in PostGreSQL
Следующее
От: Tino Wildenhain
Дата:
Сообщение: Re: Help : Microsoft SQL Server equivalents in