Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 2E8EDEDF370 for ; Tue, 22 May 2012 17:05:11 -0300 (ADT) Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SWvKO-0001eS-IK for pgsql-admin@postgresql.org; Tue, 22 May 2012 20:05:10 +0000 Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.2/8.14.2) with ESMTP id q4MK4tHE007270; Tue, 22 May 2012 16:04:55 -0400 (EDT) To: Vincent Dautremont cc: pgsql-admin@postgresql.org Subject: Re: out of memory error In-reply-to: References: <3902.1337708023@sss.pgh.pa.us> <5105.1337711403@sss.pgh.pa.us> Comments: In-reply-to Vincent Dautremont message dated "Tue, 22 May 2012 15:46:41 -0400" Date: Tue, 22 May 2012 16:04:55 -0400 Message-ID: <7269.1337717095@sss.pgh.pa.us> From: Tom Lane X-Pg-Spam-Score: -1.9 (-) X-Archive-Number: 201205/85 X-Sequence-Number: 39574 Vincent Dautremont writes: >> An entirely blue-sky guess as >> to what your code might be doing to trigger such a problem is if you >> were constantly replacing the same function's definition via CREATE OR >> REPLACE FUNCTION. > Do you mean that what would happen is that when we call the plpgsql > function, it executes each time a create or replace, then execute the > function ? > because my functions are all written like that : > -- Function: spzoneinsert(integer, integer) >> CREATE OR REPLACE FUNCTION spzoneinsert(i_zoneid integer, i_output_port >> integer) >> RETURNS void AS Well, yeah, that is the common way to define a function. The question was about whether you are constantly re-executing this same SQL thousands of times over the course of a session. I think it would take actually using the function in between such redefinitions to provoke a plan leak, but if you were doing that it might explain the problem. regards, tom lane