Re: template Database

From: "Darko Prenosil" <Prenosil(dot)Darko(at)finteh(dot)hr>
To: "Bob T" <rjtalbo(at)attglobal(dot)net>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: template Database
Date: 2002-02-25 08:06:35
Message-ID: 012901c1bdd3$8fd90c40$f600000a@darko
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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
To: pgsql-general(at)postgresql(dot)org
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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message mohan ananthiah 2002-02-25 08:31:10 Urgnt. - problem starting postgres
Previous Message Stephan Szabo 2002-02-25 07:59:00 Re: About functions