Re: How to move a database from HP server to Linux Server that had already one database.

Поиск
Список
Период
Сортировка
От Kevin Grittner
Тема Re: How to move a database from HP server to Linux Server that had already one database.
Дата
Msg-id 4C4431DE02000025000338CC@gw.wicourts.gov
обсуждение исходный текст
Ответ на Re: How to move a database from HP server to Linux Server that had already one database.  ("ENGEMANN, DAYSE" <dayse.engemann@hp.com>)
Ответы Re: How to move a database from HP server to Linux Server that had already one database.  ("ENGEMANN, DAYSE" <dayse.engemann@hp.com>)
Список pgsql-admin
"ENGEMANN, DAYSE" <dayse.engemann@hp.com> wrote:

> If I use the  :
> Origim: pg_dump -Ft -b db_name > file.tar
> Target: pg_restore -d new_db file.tar
>
> The target server has a db, using PGDATA=/postgres, the same in
> the other server... There is any risk to lost any data?

Restoring to a new database should not put the data in pre-existing
databases at risk.  I wouldn't recommend the tar format for your
dump, though -- I've had better luck with custom if I want a
"structured" dump from which I can selectively restore.  If you want
the whole thing, and don't need an intermediate copy (two big "ifs",
I know), you could do something like this on the target machine:

pg_dump -h sourcemachine -U sourceuser dbname | psql dbname

-Kevin

В списке pgsql-admin по дате отправления:

Предыдущее
От: "ENGEMANN, DAYSE"
Дата:
Сообщение: Re: How to move a database from HP server to Linux Server that had already one database.
Следующее
От: "Kevin Grittner"
Дата:
Сообщение: Re: Weird sorting order