Обсуждение: Re: How to move a DB from one server to another...

Поиск
Список
Период
Сортировка

Re: How to move a DB from one server to another...

От
"Andrew Dunstan"
Дата:
First, your mailer's habit of putting "R:" instead of the standard "Re:" at
the front of replies is annoying. You need to fix it.

Second, of course pg_restore works on Windows. The most common mistakes in
using pg_dump/pg_restore (on all platforms) are:
. not using pg_dump from the target version, and
. trying to use pg_restore rather than psql to restore a text format dump.

I suggest you try using pg_dump -F c on your Windows machine to dump the
remote db and then try pg_restore on the result to load your copy. If that
gives you trouble then tell us *precisely* what the trouble is.

cheers

andrew




Etheye said:
> Hello Harald,
>
> uhm, you may have lost my first message... I said that I am unable to
> run pg_restore on a different computer other than the one pg_dump was
> used on. I always get a return code of 1 (error). I can easily and
> quickly dump a database with pg_dump but I can't restore it on a PC
> different from the one used to back it up. And I really can't
> understand why, I have tried all possible options...
>
> I'm running PostgreSQL 8.0.3 on Win32. I've found some solutions for
> Linux but nobody was able to help me regarding the Windows platform.
>
> Thanks,
>
> Federico
>
>
>
>  _____
>
> Da: Harald Armin Massa [mailto:haraldarminmassa@gmail.com]
> Inviato: giovedì 23 giugno 2005 12.14
> A: Federico Simonetti (Etheye)
> Cc: pgsql-hackers-win32@postgresql.org
> Oggetto: Re: R: [pgsql-hackers-win32] How to move a DB from one server
> to another...
>
>
> Federico,
>
>
> Of course we could use SQL (CREATE DATABASE, CREATE TABLE, INSERT
> INTO....) but this would take years on large databases, while a rough
> "copy this  folder to the new server" would take just a few seconds.
>
>
>
> I do copys of databases every other day. pg_dump and pg_restore work
> like a breeze on databases with around 1 gig of stuff, and I do not
> even use the binary format and use intermediate files.
>
> Where ist the performance bottleneck you are speaking of?
>
> Harald
>
> --
> GHUM Harald Massa
> persuasion python postgresql
> Harald Armin Massa
> Reinsburgstraße 202b
> 70197 Stuttgart
> 0173/9409607




R: R: How to move a DB from one server to another...

От
"Federico Simonetti (Etheye)"
Дата:
Hello Harald,
 
uhm, you may have lost my first message... I said that I am unable to run pg_restore on a different computer other than the one pg_dump was used on. I always get a return code of 1 (error). I can easily and quickly dump a database with pg_dump but I can't restore it on a PC different from the one used to back it up. And I really can't understand why, I have tried all possible options...
 
I'm running PostgreSQL 8.0.3 on Win32. I've found some solutions for Linux but nobody was able to help me regarding the Windows platform.
 
Thanks,
 
Federico
 


Da: Harald Armin Massa [mailto:haraldarminmassa@gmail.com]
Inviato: giovedì 23 giugno 2005 12.14
A: Federico Simonetti (Etheye)
Cc: pgsql-hackers-win32@postgresql.org
Oggetto: Re: R: [pgsql-hackers-win32] How to move a DB from one server to another...

Federico,
Of course we could use SQL (CREATE DATABASE, CREATE TABLE, INSERT INTO....)
but this would take years on large databases, while a rough "copy this
folder to the new server" would take just a few seconds.

I do copys of databases every other day. pg_dump and pg_restore work like a breeze on databases with around 1 gig of stuff, and I do not even use the binary format and use intermediate files.

Where ist the performance bottleneck you are speaking of?

Harald

--
GHUM Harald Massa
persuasion python postgresql
Harald Armin Massa
Reinsburgstraße 202b
70197 Stuttgart
0173/9409607

Re: R: R: How to move a DB from one server

От
Jochem van Dieten
Дата:
Federico Simonetti (Etheye) wrote:
>
> uhm, you may have lost my first message... I said that I am unable to
> run pg_restore on a different computer other than the one pg_dump was
> used on. I always get a return code of 1 (error). I can easily and
> quickly dump a database with pg_dump but I can't restore it on a PC
> different from the one used to back it up. And I really can't understand
> why, I have tried all possible options...

If you can not restore a dump, you are either doing something
wrong or you have discovered a bug:
http://www.postgresql.org/docs/8.0/interactive/bug-reporting.html

Jochem

Re: R: R: How to move a DB from one server to another...

От
Tom Lane
Дата:
"Federico Simonetti (Etheye)" <flame@etheye.com> writes:
> uhm, you may have lost my first message... I said that I am unable to =
> run
> pg_restore on a different computer other than the one pg_dump was used =
> on. I
> always get a return code of 1 (error).

What is the error message, exactly?

You do realize that the default output format of pg_dump is a plain text
file that you just feed into psql?  pg_restore is only used with -Fc or -Ft
output formats.

            regards, tom lane