Re: template Database - Mailing list pgsql-general

From Darko Prenosil
Subject Re: template Database
Date
Msg-id 012901c1bdd3$8fd90c40$f600000a@darko
Whole thread Raw
In response to template Database  ("Bob T" <rjtalbo@attglobal.net>)
List pgsql-general
Taken from documentation:
 
CREATE DATABASE actually works by copying an existing database. By default, it copies the standard system database named template1. Thus that database is the "template" from which new databases are made. If you add objects to template1, these objects will be copied into subsequently created user databases. This behavior allows site-local modifications to the standard set of objects in databases. For example, if you install the procedural language plpgsql in template1, it will automatically be available in user databases without any extra action being taken when those databases are made.
 
There is a second standard system database named template0. This database contains the same data as the initial contents of template1, that is, only the standard objects predefined by your version of PostgreSQL. template0 should never be changed after initdb. By instructing CREATE DATABASE to copy template0 instead of template1, you can create a "virgin" user database that contains none of the site-local additions in template1. This is particularly handy when restoring a pg_dump dump: the dump script should be restored in a virgin database to ensure that one recreates the correct contents of the dumped database, without any conflicts with additions that may now be present in template1.
----- Original Message -----
From: Bob T
Sent: Sunday, February 24, 2002 6:10 AM
Subject: [GENERAL] template Database

I installed Cygwin on WInXP..with Cygwin I installed/initialized Postgresql.
However when completed I had a template0 and a template1.
Maybe I initialzed twice..not sure.
 
 Template0 is unuseable and refuses connections. Template1 is the default
template database. I tried but can not drop template0. How do I rid my server of the useless template0. The server consol will and does show Fatals when
inoperation.
 
So How do I drop the useless template?
 
BobT

pgsql-general by date:

Previous
From: "Boulgakov, Andrei"
Date:
Subject: Hebrew support?
Next
From: Peter Lacey
Date:
Subject: Re: Starting Postmaster