Ted Toth <txtoth@xxxxxxxxx> writes: > On Tue, Nov 28, 2017 at 9:59 PM, Tom Lane <tgl@xxxxxxxxxxxxx> wrote: >> So whatever's going on here, there's more to it than a giant client-issued >> INSERT (or COPY), or for that matter a large number of small ones. What >> would seem to be required is a many-megabyte-sized plpgsql function body >> or DO block. > Yes I did generate 1 large DO block: Apparently by "large" you mean "hundreds of megabytes". Don't do that, at least not on a machine that hasn't got hundreds of megabytes to spare. The entire thing has to be sucked into menory and parsed before anything will happen. regards, tom lane