Harry,
> The reason I say it runs out of memory is the message:
> ERROR: Memory exhausted in AllocSetAlloc(36)
> in the log file, and I am running 'top' and see the process hit 512MB at
> about this point!
Hmmm ... this is highly unlikely to be becuase of the transaction. When
Postgres runs out of available RAM, it starts swapping to disk ... which can
take hours, but will *not* produce that error.
What did you set your shared_buffers and sort_mem to? What OS are you on?
> In fact my *test* function consists of a simple scan through a database,
> and 3 INSERTs into a new table for each record in the original, where
> the values inserted are derived from values in the original.
Postgresql should be able to handle this regardless of table size, it's just a
question of speed.
--
Josh Berkus
Aglio Database Solutions
San Francisco