On Tue, Oct 11, 2011 at 02:25:20PM +0200, Andreas Forø Tollefsen wrote: > I also tried to close the db1 connection for each year in the loop, and > reopen the connection for the next year in the loop. Same problem. > I have tried both with insert into ... select .. and select into annual > tables and the put them together. Same problem. Then I guess the problem is with the specific data you encounter at the given year. Can you reproduce the hangup in the query for a single year ? Keep an eye on memory use and CPU utilization. --strk; () Free GIS & Flash consultant/developer /\ http://strk.keybit.net/services.html -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general