Received: from femail3.sdc1.sfba.home.com (femail3.sdc1.sfba.home.com [24.0.95.83]) by hub.org (8.10.1/8.10.1) with ESMTP id e8BNLN708413 for ; Mon, 11 Sep 2000 19:21:24 -0400 (EDT) Received: from home.com ([24.15.16.244]) by femail3.sdc1.sfba.home.com (InterMail vM.4.01.03.00 201-229-121) with ESMTP id <20000911232039.CCJI2358.femail3.sdc1.sfba.home.com@home.com> for ; Mon, 11 Sep 2000 16:20:39 -0700 Message-ID: <39BD6A40.67501463@home.com> Date: Mon, 11 Sep 2000 19:26:56 -0400 From: Tim Quinlan X-Mailer: Mozilla 4.73 [en] (X11; I; Linux 2.2.16 i686) X-Accept-Language: en MIME-Version: 1.0 To: pgsql-admin@postgresql.org Subject: Re: backup/restore References: <20000908161320.C18742@axispt.com> <20000911095436.D13906@rice.edu> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Archive-Number: 200009/27 This happens on Slackware as well. "Ross J. Reedstrom" wrote: > On Fri, Sep 08, 2000 at 04:13:20PM -0700, Lindell Alderman wrote: > > I am trying to backup and restore a database, but when run the following: > > > > dropdb test > > createdb test > > > > I find that the newly created database "test" is not empty but still has > > all of the old relations and tables in it. How do I destroy a database > > so that it is truly gone!?!?!? I need a totally clean databaes to restore > > my data into. > > I'm going to put on my swami hat and read your mind now: > > Ah, your using Linux, specifically the Debian distribution, are you not? > > The problem is that psql by default connects to a database named the same > as the unix username, except on Debian, where it defaults to connecting > to the template1 database, since this is guaranteed to always exist. The > primary purpose of template1 is to serve as a (surprise) template to > build new databases on. > > What does this mean? Well, if you put anything in template1 (like install > the pgpsql scipt language) it will, be default, be installed in all your > new dbs. > > Unfortunately, if you accidently create tables in template1 (on Debian, > just forgetting to put the db name in a psql command line will do it), > they'll end up getting copied into every new db after that. > > So, connect to template1, and delete everything you don't want from there. > > Ross (learned from experience, I did) > -- > Ross J. Reedstrom, Ph.D., > NSBRI Research Scientist/Programmer > Computer and Information Technology Institute > Rice University, 6100 S. Main St., Houston, TX 77005