Skip site navigation (1) Skip section navigation (2)

Re: Copy database

From: "Jim C(dot) Nasby" <jnasby(at)pervasive(dot)com>
To: "Uwe C(dot) Schroeder" <uwe(at)oss4u(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org,Krzysztof Szadkowski <kszadkow(at)eldip(dot)lodz(dot)pl>,pgsql-admin-owner(at)postgresql(dot)org
Subject: Re: Copy database
Date: 2006-01-30 23:55:11
Message-ID: 20060130235511.GN3920@pervasive.com (view raw or flat)
Thread:
Lists: pgsql-admin
createdb --template=sourcedatabase newdatabase will also work (and
probably work faster) if you can kick everyone out of sourcedatabase and
you're doing all this on one machine.

On Sun, Jan 29, 2006 at 07:31:29PM -0800, Uwe C. Schroeder wrote:
> pg_dump -h sourcehost -U sourceuser sourcedatabase | psql -h desthost -U 
> destuser destdatabase
> 
> you may have to add a parameter for the password depending on your pg_hba.conf 
> settings. Both databases need to be network enabled and have a pg_hba.conf 
> entry for the machine you're running this command on.
>  
> 
> 
> On Monday 23 January 2006 00:49, Krzysztof Szadkowski wrote:
> > Hi all,
> >
> > I am looking for a way to copy whole database to another existing
> > database.
> > Any suggestions ?
> >
> > ---------------------------------------------
> > Best regards,
> >      Krzysztof Szadkowski
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 9: In versions below 8.0, the planner will ignore your desire to
> >        choose an index scan if your joining column's datatypes do not
> >        match
> 
> -- 
> 	UC
> 
> --
> Open Source Solutions 4U, LLC	1618 Kelly St
> Phone:  +1 707 568 3056		Santa Rosa, CA 95401
> Cell:   +1 650 302 2405		United States
> Fax:    +1 707 568 6416
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
> 

-- 
Jim C. Nasby, Sr. Engineering Consultant      jnasby(at)pervasive(dot)com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461

In response to

pgsql-admin by date

Next:From: Tom LaneDate: 2006-01-31 02:01:09
Subject: Re: Vacuum - Out of memory
Previous:From: Jeff FrostDate: 2006-01-30 22:41:43
Subject: Re: pg_stat_user_indexes view clarification

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group