Re: Copying large tables with DBLink - Mailing list pgsql-admin

From Tom Lane
Subject Re: Copying large tables with DBLink
Date
Msg-id 5020.1111693222@sss.pgh.pa.us
Whole thread Raw
In response to Copying large tables with DBLink  ("Chris Hoover" <revoohc@sermonaudio.com>)
List pgsql-admin
"Chris Hoover" <revoohc@sermonaudio.com> writes:
> 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.

You're not going to be able to do that with dblink, nor any other
set-returning function, because the current implementation of SRFs
always materializes the entire function result in temporary memory/swap.

Consider something like
    pg_dump -t srctab srcdb | psql destdb
instead.

            regards, tom lane

pgsql-admin by date:

Previous
From: Joe Conway
Date:
Subject: Re: Copying large tables with DBLink
Next
From: Michael Fuhr
Date:
Subject: Re: Copying large tables with DBLink