pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Copy database
4+ messages / 4 participants
[nested] [flat]

* Copy database
@ 2006-01-23 08:49  Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>
  0 siblings, 1 reply; 4+ messages in thread

From: Krzysztof Szadkowski @ 2006-01-23 08:49 UTC (permalink / raw)
  To: pgsql-admin-owner@postgresql.org

Hi all,

I am looking for a way to copy whole database to another existing
database.
Any suggestions ?

---------------------------------------------
Best regards, 
     Krzysztof Szadkowski
     




^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Copy database
@ 2006-01-30 03:31  Uwe C. Schroeder <uwe@oss4u.com>
  parent: Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>
  0 siblings, 2 replies; 4+ messages in thread

From: Uwe C. Schroeder @ 2006-01-30 03:31 UTC (permalink / raw)
  To: pgsql-admin; +Cc: Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>; pgsql-admin-owner@postgresql.org

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



^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Copy database
@ 2006-01-30 08:04  Christian Sengstock <csengstock@gmail.com>
  parent: Uwe C. Schroeder <uwe@oss4u.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Christian Sengstock @ 2006-01-30 08:04 UTC (permalink / raw)
  To: Uwe C. Schroeder <uwe@oss4u.com>; +Cc: pgsql-admin@postgresql.org, Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>; pgsql-admin-owner@postgresql.org

2006/1/30, Uwe C. Schroeder <uwe@oss4u.com>:

>
>
>
> 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 ?


Sometimes you want to copy the whole DBMS to another machine where the same
postgres version is running. You can just copy the ./data directory, check
the permissions (chown -R postgres ./data) and run postmaster with this data
directory (postmaster ... -d ./data).

Note: Like that, you can't copy a certain database. You have to use the same
postgres version for that...

Chris

^ permalink  raw  reply  [nested|flat] 4+ messages in thread

* Re: Copy database
@ 2006-01-30 23:55  Jim C. Nasby <jnasby@pervasive.com>
  parent: Uwe C. Schroeder <uwe@oss4u.com>
  1 sibling, 0 replies; 4+ messages in thread

From: Jim C. Nasby @ 2006-01-30 23:55 UTC (permalink / raw)
  To: Uwe C. Schroeder <uwe@oss4u.com>; +Cc: pgsql-admin@postgresql.org, Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>; pgsql-admin-owner@postgresql.org

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@pervasive.com
Pervasive Software      http://pervasive.com    work: 512-231-6117
vcard: http://jim.nasby.net/pervasive.vcf       cell: 512-569-9461



^ permalink  raw  reply  [nested|flat] 4+ messages in thread


end of thread, other threads:[~2006-01-30 23:55 UTC | newest]

Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-01-23 08:49 Copy database Krzysztof Szadkowski <kszadkow@eldip.lodz.pl>
2006-01-30 03:31 ` Uwe C. Schroeder <uwe@oss4u.com>
2006-01-30 08:04   ` Christian Sengstock <csengstock@gmail.com>
2006-01-30 23:55   ` Jim C. Nasby <jnasby@pervasive.com>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox