Re: best method to copy data across databases

Поиск
Список
Период
Сортировка
От reina_ga@hotmail.com (Tony Reina)
Тема Re: best method to copy data across databases
Дата
Msg-id 272e4be7.0407020310.18785557@posting.google.com
обсуждение исходный текст
Ответы Re: best method to copy data across databases
Список pgsql-sql
ctrl@altonsys.com (ctrl) wrote in message news:<46a31c4d.0407011942.37839bb0@posting.google.com>...
> I need to copy data that I have on a table in one Postgres database
> into another table, on a different database. The destination table is
> not identical with the source table so I need to do some mapping
> between the 2 tables.
> What would be the best (and quickest) way to transfer the data? (there
> are over 500k rows)
> 
> thanks!

If the 2 tables have different arrangements, then I'm not sure if
there is a quick way. The safest way is probably to do a pg_dump
--attribute-inserts.

From the pg_dump manpage,

--attribute-inserts
             Dump  data as INSERT commands with explicit column names
(INSERT             INTO table (column, ...) VALUES ...). This will make
restoration             very  slow,  but  it is necessary if you desire to
rearrange the             column ordering.

HTH,
-Tony


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

Предыдущее
От: Michael Kleiser
Дата:
Сообщение: Re: quoting
Следующее
От: Tom Lane
Дата:
Сообщение: Re: best method to copy data across databases