Received: from localhost (maia-4.hub.org [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id C39139FBC02 for ; Thu, 3 May 2007 02:55:24 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 71067-01 for ; Thu, 3 May 2007 02:55:22 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from sss.pgh.pa.us (sss.pgh.pa.us [66.207.139.130]) by postgresql.org (Postfix) with ESMTP id 7728E9FBC11 for ; Thu, 3 May 2007 02:55:21 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.13.6/8.13.6) with ESMTP id l435tItL027836; Thu, 3 May 2007 01:55:18 -0400 (EDT) To: "Collin Peters" cc: pgsql-sql@postgresql.org Subject: Re: Dynamic prepare possible in plpgsql? In-reply-to: References: <11208.1177980742@sss.pgh.pa.us> <36e682920705011016u6af5810bv4fc3ad7feb0fbe8e@mail.gmail.com> Comments: In-reply-to "Collin Peters" message dated "Wed, 02 May 2007 08:53:13 -0700" Date: Thu, 03 May 2007 01:55:18 -0400 Message-ID: <27835.1178171718@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200705/13 X-Sequence-Number: 28294 "Collin Peters" writes: > So if I have an INSERT inside a LOOP in a plpgsql function, it is only > prepared once? Once per session, yes (barring some special cases like polymorphic functions and trigger functions, which would get prepared once per session per calling situation) regards, tom lane