select ... for update in plpgsql

From: Jie Liang <jliang(at)ipinc(dot)com>
To: pgsql-sql(at)postgresql(dot)org, pgsql-admin(at)postgresql(dot)org
Subject: select ... for update in plpgsql
Date: 2001-04-20 20:03:02
Message-ID: Pine.BSF.4.10.10104201145490.80684-100000@tidal.ipinc.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin pgsql-sql


Hi,

I have a question about 'select ... for update';
according to the docs,
clause 'for update' will lock selected rows,
I believe it should be put into a
begin;
select ... for update;
update ...;
end;
block.

however, if I use it in a plpgsql function,
do I need another pair of begin...end?
or say begin...end in plpgsql can lock chosen rows until
updated ALL ROWS?
if not, do you have any suggestion?

Jie LIANG

St. Bernard Software

10350 Science Center Drive
Suite 100, San Diego, CA 92121
Office:(858)320-4873

jliang(at)ipinc(dot)com
www.stbernard.com
www.ipinc.com

In response to

  • Thank you at 2001-04-20 13:11:16 from Mateusz Mazur

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Dan Browning 2001-04-21 01:18:48 Re: Bugs in PostgreSQL v7.1 rpms for RedHat
Previous Message lbottorff 2001-04-20 15:40:48 New cygwin includes Postgresql 7.1-2!?

Browse pgsql-sql by date

  From Date Subject
Next Message Mark Stosberg 2001-04-20 20:38:09 creating tables that are visible across databases
Previous Message Mark Stosberg 2001-04-20 18:40:41 Re: Client/Server Security question