Copying large tables with DBLink - Mailing list pgsql-admin

From Chris Hoover
Subject Copying large tables with DBLink
Date
Msg-id 42430E20.1010600@sermonaudio.com
Whole thread Raw
Responses Re: Copying large tables with DBLink  (Joe Conway <mail@joeconway.com>)
Re: Copying large tables with DBLink  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: Copying large tables with DBLink  (Michael Fuhr <mike@fuhr.org>)
List pgsql-admin
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?  The problem we were trying to
solve is the fact that due to new column additions that are populated
during the conversion, our db's are doubling in space.  This is
requiring lengthy vacuum fulls to reclaim the space and making for a
very long conversion time.

We are very concerned that this system lockup could happen on our
production boxes since we have several db's that are very large and
probably have tables larger than our memory on the systems.

Anyway, any ideas on how to get around this, or how we might speed it up
and not use so much space would be appreciated.

Chris

PG 7.3.4


pgsql-admin by date:

Previous
From: John DeSoi
Date:
Subject: Re: Admin tools with the ability to alter a field type?
Next
From: Joe Conway
Date:
Subject: Re: Copying large tables with DBLink