Re: looking for doc - Mailing list pgsql-admin

From Ian Lawrence Barwick
Subject Re: looking for doc
Date
Msg-id CAB8KJ=jGhK94AoBrurG71jmFXeuDt+_Bru25FO0jUoV9YgzqqA@mail.gmail.com
Whole thread Raw
In response to Re: looking for doc  (Kasia Tuszynska <ktuszynska@esri.com>)
List pgsql-admin
2014-03-18 6:54 GMT+09:00 Kasia Tuszynska <ktuszynska@esri.com>:
> Ian,
> Thanks that is the really only doc that comes up when I search for this. It discusses how to call a template to
createa new db, but it does not list the differences between them. I am going to try to just find a definition of both. 

Basically, "template1" is the default template used for creating new databases.
Normally template1 and template0 are identical, however it's possible
to customise
template1 if there are some modifications you wish to  have automatically in
all new databases:

    template1=# CREATE LANGUAGE plperlu;
    CREATE LANGUAGE
    Time: 1033.037 ms
    template1=# CREATE DATABASE foo;
    CREATE DATABASE
    Time: 3267.212 ms
    template1=# \c foo
    You are now connected to database "foo" as user "barwick".
    foo=# \dL
                         List of languages
      Name   |  Owner  | Trusted |         Description
    ---------+---------+---------+------------------------------
     plperlu | barwick | f       |
     plpgsql | barwick | t       | PL/pgSQL procedural language
    (2 rows)


template0 cannot be changed and serves as a "backup" if you need
to restore template1, or create a new database without the customisations
in template1.

Regards

Ian Barwick


pgsql-admin by date:

Previous
From: Kasia Tuszynska
Date:
Subject: Re: looking for doc
Next
From: David Johnston
Date:
Subject: Re: looking for doc