Re: Table Export & Import

Поиск
Список
Период
Сортировка
От Michel Pelletier
Тема Re: Table Export & Import
Дата
Msg-id CACxu=vKjzmRqqtak6D3QrxxBc7_paeYpj40UFTuRqMD97pERgA@mail.gmail.com
обсуждение исходный текст
Ответ на Table Export & Import  (Sathish Kumar <satcse88@gmail.com>)
Список pgsql-general
As other have pointed out, you can take a pg_dump at anytime.  You can provide arguments to pg_dump to only dump a subset of the database (like one table).  Also mentioned is using a foreign data wrapper (FDW).  yet another approach is to use the "copy to/from program" command to stream the table from one db to the other using netcat (nc):

On destination server:

\copy table_name to program "nc origin_server 9999";

On origin server:

\copy table_name from program ''nc -l 9999";

If your network is slower than your cpu you can compress the data by piping it through lz4 (or gzip/bzip whatever, but lz4 is fast both directions for streaming).

-Michel


On Sun, Mar 31, 2019 at 11:10 PM Sathish Kumar <satcse88@gmail.com> wrote:
Hi Team,

We have a requirement to copy a table from one database server to another database server. We are looking for a solution to achieve this with lesser downtime on Prod. Can you help us with this?

Table Size: 160GB
Postgresql Server Version: 9.5


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

Предыдущее
От: Adrian Klaver
Дата:
Сообщение: Re: Table Export & Import
Следующее
От: Sathish Kumar
Дата:
Сообщение: Re: Table Export & Import