Re: backup/restore

From: Tim Quinlan <trquinlan(at)home(dot)com>
To: pgsql-admin(at)postgresql(dot)org
Subject: Re: backup/restore
Date: 2000-09-11 23:26:56
Message-ID: 39BD6A40.67501463@home.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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., <reedstrm(at)rice(dot)edu>
> NSBRI Research Scientist/Programmer
> Computer and Information Technology Institute
> Rice University, 6100 S. Main St., Houston, TX 77005

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Max Pyziur 2000-09-12 03:03:26 Re: [SQL] Re: [BUGS] "ORDER BY" issue - is this a bug?
Previous Message John McKown 2000-09-11 21:38:49 Re: same postmaster, different directory? V7.0.2