Re: [HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2013-01-15 Thread Tom Lane
Jan Wieck writes: > On 12/20/2012 4:47 PM, Dimitri Fontaine wrote: >> Tom Lane writes: >>> The reason this fails is that you've got a half-megabyte source string, >>> and each of the 11000 plans that are due to be created from it saves >>> its own copy of the source string. Hence, 5500 megabytes

Re: [HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2013-01-15 Thread Jan Wieck
On 12/20/2012 4:47 PM, Dimitri Fontaine wrote: Tom Lane writes: The reason this fails is that you've got a half-megabyte source string, and each of the 11000 plans that are due to be created from it saves its own copy of the source string. Hence, 5500 megabytes needed just for source strings.

Re: [HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2012-12-20 Thread Dimitri Fontaine
Tom Lane writes: > The reason this fails is that you've got a half-megabyte source string, > and each of the 11000 plans that are due to be created from it saves > its own copy of the source string. Hence, 5500 megabytes needed just > for source strings. > > We could possibly fix this by inventin

Re: [HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2012-12-19 Thread Tomas Vondra
On 20.12.2012 02:29, Tom Lane wrote: > Tomas Vondra writes: >> What it does: > >> 1) creates a simple table called "test" with one text column. > >> 2) creates a plpgsql function with one parameter, and all that function >>does is passing the parameter to EXECUTE > >> 3) calls the function

Re: [HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2012-12-19 Thread Tom Lane
Tomas Vondra writes: > What it does: > 1) creates a simple table called "test" with one text column. > 2) creates a plpgsql function with one parameter, and all that function >does is passing the parameter to EXECUTE > 3) calls the function with a string containing many INSERTs into the >

[HACKERS] strange OOM errors with EXECUTE in PL/pgSQL

2012-12-19 Thread Tomas Vondra
Hi, one of our local users reported he's getting OOM errors on 9.2, although on 9.1 the code worked fine. Attached is a simple test-case that should give you an OOM error almost immediately. What it does: 1) creates a simple table called "test" with one text column. 2) creates a plpgsql functio