Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id A538964FDA2 for ; Tue, 14 Oct 2008 21:43:41 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 78434-08 for ; Tue, 14 Oct 2008 21:43:38 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id DA67764FD91 for ; Tue, 14 Oct 2008 21:43:38 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id m9F0hZEF006593; Tue, 14 Oct 2008 20:43:35 -0400 (EDT) To: "Scott Marlowe" cc: "Marc Fromm" , "pgsql-admin@postgresql.org" Subject: Re: log activity questions In-reply-to: References: Comments: In-reply-to "Scott Marlowe" message dated "Tue, 14 Oct 2008 18:38:16 -0600" Date: Tue, 14 Oct 2008 20:43:35 -0400 Message-ID: <6592.1224031415@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200810/109 X-Sequence-Number: 30565 "Scott Marlowe" writes: > Template0 is your "man, I really screwed up template1" get out of jail > free database. It is normally set to not allow connections (look at > "select * from pg_databases;" for the field that does or doesn't allow > connections). If you ever did terrible things to templat1, you could > set template0 to datallowcon=t and then drop and recreate template1 > using template0 as the template. Then vacuum freeze it and set it to > not allow connections again to template0 to get it back to normal > again. You don't need to (and shouldn't) touch datallowconn while doing the above. Just use some third database to launch the "DROP DATABASE template1" and "CREATE DATABASE template1 WITH TEMPLATE template0" commands. BTW: the other, more common use of template0 is as a template for making a database to restore a dump into. If you use template1 then any local additions in template1 pose a hazard for the dump (which probably also tries to define those objects). regards, tom lane