Re: Copying large tables with DBLink

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: Copying large tables with DBLink
Дата
Msg-id 42431326.2010908@joeconway.com
обсуждение исходный текст
Ответ на Copying large tables with DBLink  ("Chris Hoover" <revoohc@sermonaudio.com>)
Список pgsql-admin
Chris Hoover wrote:
> Has anyone had problems with memory exhaustion and dblink?  We were
> trying to use dblink to convert our databases to our new layout, and had
> our test server lock up several times when trying to copy a table that
> was significantly larger than our memory and swap.
> Basically where were doing an insert into <table> select * from
> dblink('dbname=olddb','select * from large_table) as t_large_table(table
> column listing);
>
> Does anyone know of a way around this?


dblink just uses libpq, and libpq reads the entire result into memory.
There is no direct way around that that I'm aware of. You could,
however, use a cursor, and fetch/manipulate rows in more reasonably
sized groups.

HTH,

Joe

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

Предыдущее
От: "Chris Hoover"
Дата:
Сообщение: Copying large tables with DBLink
Следующее
От: Tom Lane
Дата:
Сообщение: Re: Copying large tables with DBLink