From: Jie Liang <jliang@ipinc.com>
To: Roberto Mello <rmello@cc.usu.edu>
Cc: pgsql-sql@postgresql.org
Cc: pgsql-hacker@postgresql.org
Subject: Re: plpgsql
Date: Sun, 22 Apr 2001 14:25:41 -0700 (PDT)
Message-ID: <Pine.BSF.4.10.10104221416150.49607-100000@tidal.ipinc.com> (raw)
In-Reply-To: <20010420195812.A24166@cc.usu.edu>
Roberto,
Thanks for your help, I read the docs.
I am still not entire sure, my problem is in my plpgsql function
I used
for rec in select ... for update loop
update stmt
end loop;
I don't want above chosen rows be selected(i.e. I want them to be lock
exclusively) by another user until transaction done.
do I need an explicit LOCK stmt?
can it be used in the plpgsql function??
Thanks again.
Jie LIANG
St. Bernard Software
10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873
jliang@ipinc.com
www.stbernard.com
www.ipinc.com
On Fri, 20 Apr 2001, Roberto Mello wrote:
> On Fri, Apr 20, 2001 at 04:58:02PM -0700, Jie Liang wrote:
> >
> > I 've a question about begin...end in plpgsql
> > does
> > sql stmts in
> > begin
> > ....
> > end;
> > will go one transaction?
>
> Read the documentation (programmer's guide). It's all there. It's to
> answer your questions that we take the time to write docs in the first
> place :)
> Short answer: everything in your function is executed in one
> transaction. BEGIN and END in PL/pgSQL are NOT the same as in the
> transaction semantics.
>
> -Roberto
> --
> +----| http://fslc.usu.edu USU Free Software & GNU/Linux Club |------+
> Roberto Mello - Computer Science, USU - http://www.brasileiro.net
> http://www.sdl.usu.edu - Space Dynamics Lab, Developer
> If at first you don't succeed, destroy all evidence that you tried.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
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 from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: jliang@ipinc.com, rmello@cc.usu.edu, pgsql-hacker@postgresql.org
Subject: Re: plpgsql
In-Reply-To: <Pine.BSF.4.10.10104221416150.49607-100000@tidal.ipinc.com>
References: <20010420195812.A24166@cc.usu.edu> <Pine.BSF.4.10.10104221416150.49607-100000@tidal.ipinc.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