Re: looking for doc

From: Ian Lawrence Barwick <barwick(at)gmail(dot)com>
To: Kasia Tuszynska <ktuszynska(at)esri(dot)com>
Cc: "pgsql-admin(at)postgresql(dot)org" <pgsql-admin(at)postgresql(dot)org>
Subject: Re: looking for doc
Date: 2014-03-17 22:23:30
Message-ID: CAB8KJ=jGhK94AoBrurG71jmFXeuDt+_Bru25FO0jUoV9YgzqqA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

2014-03-18 6:54 GMT+09:00 Kasia Tuszynska <ktuszynska(at)esri(dot)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 create a 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message David Johnston 2014-03-17 22:25:46 Re: looking for doc
Previous Message Kasia Tuszynska 2014-03-17 21:54:33 Re: looking for doc