Received: from localhost (maia-2.hub.org [200.46.204.187]) by postgresql.org (Postfix) with ESMTP id D45949F9CDC for ; Tue, 21 Aug 2007 12:30:37 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.187]) (amavisd-maia, port 10024) with ESMTP id 00495-07 for ; Tue, 21 Aug 2007 12:30:27 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from rv-out-0910.google.com (rv-out-0910.google.com [209.85.198.184]) by postgresql.org (Postfix) with ESMTP id 983109F9D44 for ; Tue, 21 Aug 2007 12:30:25 -0300 (ADT) Received: by rv-out-0910.google.com with SMTP id l15so1189169rvb for ; Tue, 21 Aug 2007 08:30:25 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=S4/vB+kN+6Ml/H93curj0wbdtqZyRBYY+EKRn48IiOSA1c/KRozRYAj3+ncDa+uI/dbKz4sD56nUlhvlIGdrFusrY6IZYhbURs6FxFamVkpijT56oIxuyrB8IaQ6w6hIJCaDzZoMJ6zun3F3r/CirSQatpX5B5K41JsEhw5skAI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:message-id:date:from:to:subject:cc:in-reply-to:mime-version:content-type:content-transfer-encoding:content-disposition:references; b=tDk2o6OlsxpaRIU354AnmgYYYp4sSUvAD6MXD07y0xEPUhJEyDzLjErsUBm8Au0Yix447MWJFTuouue1+uY/cPthUlIujCg0bjFPji4AA7AOJD0NaHpJe3TthOuXIHK8x3Pg49KsT0jT1Hl1Q5ZCw+sgsMmsCzpz4GcHamLBcVk= Received: by 10.141.211.13 with SMTP id n13mr3431238rvq.1187710224910; Tue, 21 Aug 2007 08:30:24 -0700 (PDT) Received: by 10.141.98.12 with HTTP; Tue, 21 Aug 2007 08:30:24 -0700 (PDT) Message-ID: Date: Tue, 21 Aug 2007 10:30:24 -0500 From: "Scott Marlowe" To: giuseppe.derossi@email.it Subject: Re: how to call sql code without function Cc: "Medi Montaseri" , pgsql-admin@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Content-Disposition: inline References: X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200708/252 X-Sequence-Number: 26583 On 8/21/07, giuseppe.derossi@email.it wrote: > > Hi Medi, > Last night, I wrote a function which perfoms a subset of queries and returns > the results of a temporary table. It's more fast than I believe and that's > ok to me. > There is a prolem : It works too fine. I'm afraid of Murphy's law. I red > into the Internet that there are problem when there is a temporary table in > a function. My queries are in direct way, that is, without Execute > statement. > > What kind of problem can arise (session,caching, and so on) ? which should > be the solution ? The only real danger of using temp tables is that if you don't vacuum often enough the system catalogs can get bloated. Also, if you create a new connection for each access, then you might wind up with a lot of pg_temp_xxx schemas laying about, but they don't really hurt anything. Generally speaking temp tables in postgresql are pretty well behaved.