Re: PREPARED ...

From: "Nigel J(dot) Andrews" <nandrews(at)investsystems(dot)co(dot)uk>
To: "alex b(dot)" <mailinglists1(at)gmx(dot)de>
Cc: Postgresql General <pgsql-general(at)postgresql(dot)org>
Subject: Re: PREPARED ...
Date: 2003-05-12 19:43:06
Message-ID: Pine.LNX.4.21.0305122036560.24875-100000@ponder.fairway2k.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 12 May 2003, alex b. wrote:

> hi
>
> I'm pretty sure you people will want kill me for this, but I've heard
> quite a lot about prepared queries..
>
> well, the pgdocs don't really clarify or give examples on how to use
> this command.
>
> besides, is it even stored? if so, then, how do you delete it, view it,
> or modify it?
>
> and most importantly, how do you use them?
>
> I have this table, I want to add a few values usint INSERT INTO, but I
> heard using this command combined with prepare speeds things up a little
> - good, so I wanted to try it, but failed miserably... :(
>
> well, any help's appreciated.

I've not tried it since I don't want an error to kill my transactions, and at
the moment I don't want to change things to allow it, but one general idea is
you do something like:

loop {

EXECUTE myname ...
if error and error is about myname not a prepared query then
PREPARE myname INSERT ...
}

Another would be:

PREPARE myname INSERT ...
loop {
EXECUTE myname ...
}

Other than that I can't say whether the docs are correct in the details but I
can't say I would expect them to be wrong.

What is it you have tried and what are the errors?

Prepared queries are only prepared in individual backends.

--
Nigel J. Andrews

In response to

Browse pgsql-general by date

  From Date Subject
Next Message =?ISO-8859-1?Q?Gr=E9gory_Faruch?= 2003-05-12 19:54:05 jdbc / user data type (written in C)
Previous Message alex b. 2003-05-12 19:29:44 PREPARED ...