Received: from tidal.ipinc.com (tidal.ipinc.com [199.245.188.85]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f3KK34371959; Fri, 20 Apr 2001 16:03:05 -0400 (EDT) (envelope-from jliang@tidal.ipinc.com) Received: from localhost (jliang@localhost) by tidal.ipinc.com (8.9.3/8.9.3) with ESMTP id NAA86978; Fri, 20 Apr 2001 13:03:02 -0700 (PDT) (envelope-from jliang@tidal.ipinc.com) Date: Fri, 20 Apr 2001 13:03:02 -0700 (PDT) From: Jie Liang To: pgsql-sql@postgresql.org, pgsql-admin@postgresql.org Subject: select ... for update in plpgsql In-Reply-To: <20010420151116.A17399@waw.pdi.net> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII X-Archive-Number: 200104/84 X-Sequence-Number: 1221 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@ipinc.com www.stbernard.com www.ipinc.com