Re: Copying a database

From: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
To: Ron Gafron <rgafron(at)sbcglobal(dot)net>
Cc: pgadmin-support(at)postgresql(dot)org
Subject: Re: Copying a database
Date: 2010-08-13 05:32:22
Message-ID: 4C64D8E6.7010302@lelarge.info
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-support

Le 13/08/2010 01:06, Ron Gafron a écrit :
> Good day all,
>
> As a relative newbie to Postgres, I am looking for the "best way" to
> make a copy of a database I am using. Is there a "standard way" to use
> pgAdmin to do this? I've seen a number of posts using the command line
> to do this, but so far, about all I've seen using pgAdmin are posts
> about using the backup/restore routine to do this, but people seem to
> have trouble with this at times.
>
> All I'm interested in copying is the database structure at this point,
> and I think I can see in pgAdmin how to do this with the backup. So,
> would the steps be.....
> 1. Create the database backup.
> 2. Create a new, empty database with a new name.
> 3. Restore the backup to the new, empty database?
>
> Thanks for any guidance you can provide, and have a good day.
>

There is two possible ways to save and restore the structure only.

If you want a custom dump, you'll have to dump all the database
(structure and data). It's on the restore step that you need to tick the
"Only schema" checkbox.

If you want a plain (SQL) dump, you have to tick the "Only schema"
checkbox before doing the dump. You don't have anything special to on
the restore step.

/me wondering why we don't propose to do a "schema only" and "data only"
dump when using a custom or tar dump.

--
Guillaume
http://www.postgresql.fr
http://dalibo.com

In response to

Responses

Browse pgadmin-support by date

  From Date Subject
Next Message Guillaume Lelarge 2010-08-13 05:33:31 Re: PgAdmin Crash
Previous Message Josh Berkus 2010-08-12 23:15:55 Re: Copying a database