X-Original-To: pgsql-admin-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 94720563D6 for ; Mon, 14 Mar 2005 20:03:45 +0000 (GMT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 43130-03 for ; Mon, 14 Mar 2005 20:03:44 +0000 (GMT) Received: from sunsite.dcc.uchile.cl (sunsite.dcc.uchile.cl [192.80.24.2]) by svr1.postgresql.org (Postfix) with ESMTP id D640C563C0 for ; Mon, 14 Mar 2005 20:03:42 +0000 (GMT) Received: from anakena.dcc.uchile.cl (anakena [192.80.24.6]) by sunsite.dcc.uchile.cl (8.12.11/8.12.11) with ESMTP id j2EK3aZ6017487; Mon, 14 Mar 2005 16:03:40 -0400 (CLT) Received: by anakena.dcc.uchile.cl (Postfix, from userid 4151) id 10AFC5251B; Mon, 14 Mar 2005 16:03:36 -0400 (CLT) Date: Mon, 14 Mar 2005 16:03:36 -0400 From: Alvaro Herrera To: Scott Marlowe Cc: Eduardo Mambrilla =?iso-8859-1?Q?Mart=EDnez?= , pgsql-admin@postgresql.org Subject: Re: How can I recreate the template0 database? Message-ID: <20050314200335.GD32097@dcc.uchile.cl> References: <1110815954.28555.37.camel@state.g2switchworks.com> Mime-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1110815954.28555.37.camel@state.g2switchworks.com> User-Agent: Mutt/1.5.6i X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.351 tagged_above=0 required=5 tests=AWL, DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200503/217 X-Sequence-Number: 16715 On Mon, Mar 14, 2005 at 09:59:14AM -0600, Scott Marlowe wrote: > On Wed, 2005-03-09 at 01:32, Eduardo Mambrilla Martínez wrote: > > I made a mistake, I droped the template0 database... > > How can I recreate it? > > Do you still have template1? If so, connect in single user mode, enter: > postgres template1 > create database template0 with template template1 > update pg_database set datallowconn = false where datname='template0'; I think it'd be wise to issue a VACUUM FULL; VACUUM FREEZE in the newly created template0 before disallowing connections to it. -- Alvaro Herrera () "El número de instalaciones de UNIX se ha elevado a 10, y se espera que este número aumente" (UPM, 1972)