Received: from localhost (maia-5.hub.org [200.46.204.182]) by postgresql.org (Postfix) with ESMTP id 4982E9FA2EF for ; Tue, 1 May 2007 14:36:26 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.182]) (amavisd-maia, port 10024) with ESMTP id 69488-09 for ; Tue, 1 May 2007 14:36:20 -0300 (ADT) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.5 Received: from nz-out-0506.google.com (nz-out-0506.google.com [64.233.162.226]) by postgresql.org (Postfix) with ESMTP id 1A6439FB990 for ; Tue, 1 May 2007 14:16:43 -0300 (ADT) Received: by nz-out-0506.google.com with SMTP id s1so1655969nze for ; Tue, 01 May 2007 10:16:43 -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=fCiyTdL2v3f3arPXZ/K+3o2pC9qdCjnAc90Q0w9gfB+wPI+SZfMo/+Y4ahHFfCpKw8eo5PPloOzWl3+g2zGquVtzb3+EBiZqH3HVZ82EOL9fJ/HNF30nkpb5yRD7FHwUBPWJ324G9av9zKOaeFF/r2VG1mODIVXTuUmGVxKevQ0= 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=XJq73fnw6ivGpEabTCBzVNm26UR5xE3wnZ3tuteDOLMDfpFrxZ2+FtiwSWhxNCY4/H+uRv4lEaH3IIlN1rHqWws3PQII6eUUvV0rmh6xsC0FeKyAmYFgcqjd75A4PjF80ALjAarZIhrlTfzotRdf2mkIRQHRqdDmB9gD6SE+G0A= Received: by 10.114.112.1 with SMTP id k1mr1517311wac.1178039802573; Tue, 01 May 2007 10:16:42 -0700 (PDT) Received: by 10.114.47.12 with HTTP; Tue, 1 May 2007 10:16:42 -0700 (PDT) Message-ID: <36e682920705011016u6af5810bv4fc3ad7feb0fbe8e@mail.gmail.com> Date: Tue, 1 May 2007 13:16:42 -0400 From: "Jonah H. Harris" To: "Collin Peters" Subject: Re: Dynamic prepare possible in plpgsql? Cc: "Tom Lane" , pgsql-sql@postgresql.org In-Reply-To: MIME-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Content-Disposition: inline References: <11208.1177980742@sss.pgh.pa.us> X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/2 X-Sequence-Number: 28283 On 5/1/07, Collin Peters wrote: > Is it faster to use PREPARE for the various INSERT statements inside a > plpgsql function? Perhaps I am wrong and it does its PREPARE work > when the function is parsed. IIRC, PLpgSQL automagically prepares each statement behind the scenes on the first use. -- Jonah H. Harris, Software Architect | phone: 732.331.1324 EnterpriseDB Corporation | fax: 732.331.1301 33 Wood Ave S, 3rd Floor | jharris@enterprisedb.com Iselin, New Jersey 08830 | http://www.enterprisedb.com/