From: Collin Peters <cadiolis@gmail.com>
To: pgsql-sql@postgresql.org
Subject: Re: Dynamic prepare possible in plpgsql?
Date: Wed, 2 May 2007 08:53:13 -0700
Message-ID: <df01c91b0705020853s6add0536i6eed538149ffb279@mail.gmail.com> (raw)
In-Reply-To: <36e682920705011016u6af5810bv4fc3ad7feb0fbe8e@mail.gmail.com>
References: <df01c91b0704301658r71068bf1jea60b8f6d6c5769c@mail.gmail.com>
<11208.1177980742@sss.pgh.pa.us>
<df01c91b0705010952s4fb5fd5fpd9f4f61ff9673875@mail.gmail.com>
<36e682920705011016u6af5810bv4fc3ad7feb0fbe8e@mail.gmail.com>
So if I have an INSERT inside a LOOP in a plpgsql function, it is only
prepared once?
Regards,
Collin
On 5/1/07, Jonah H. Harris <jonah.harris@gmail.com> wrote:
> On 5/1/07, Collin Peters <cadiolis@gmail.com> 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/
>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: cadiolis@gmail.com
Subject: Re: Dynamic prepare possible in plpgsql?
In-Reply-To: <df01c91b0705020853s6add0536i6eed538149ffb279@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox