X-Original-To: pgsql-general@postgresql.org Received: from spampd.localdomain (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 60DB9475D0F; Tue, 1 Apr 2003 06:11:22 -0500 (EST) Received: from yara.imsd.uni-mainz.de (yara.IMSD.Uni-Mainz.DE [134.93.144.68]) by postgresql.org (Postfix) with ESMTP id 782D1475AF8; Tue, 1 Apr 2003 06:10:50 -0500 (EST) Received: (from smap@localhost) by yara.imsd.uni-mainz.de (8.9.3/8.9.3/lxs_5.2) id NAA01371; Tue, 1 Apr 2003 13:13:06 +0200 Received: from hermes.imsd.uni-mainz.de(134.93.64.9) by yara.imsd.uni-mainz.de via smap (V2.1/2.1+anti-relay+anti-spam) id xma001362; Tue, 1 Apr 03 13:12:49 +0200 Received: from magnus (unverified [134.93.64.112]) by hermes.imsd.uni-mainz.de (EMWAC SMTPRS 0.83) with SMTP id ; Tue, 01 Apr 2003 13:28:31 +0200 Content-Type: text/plain; charset="us-ascii" From: Markus Wagner Organization: IMBEI To: pgsql-general@postgresql.org Subject: row-level locking Date: Tue, 1 Apr 2003 12:36:41 +0100 X-Mailer: KMail [version 1.4] Cc: pgsql-odbc@postgresql.org MIME-Version: 1.0 Message-Id: <200304011336.41155.wagner@imbei.uni-mainz.de> Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, hits=-2.5 required=5.0 tests=BAYES_20,HTML_TAG_BALANCE_TABLE,RATWARE_EMWAC version=2.50 X-Spam-Level: X-Spam-Checker-Version: SpamAssassin 2.50 (1.173-2003-02-20-exp) X-Archive-Number: 200304/6 X-Sequence-Number: 40071 Hi, we need to prevent write access for a single row of a table for a short tim= e. We found a short description for the "SELECT FOR UPDATE" statement: "perform exclusive locking of selected rows" Now my question: Is this a good method for our purpose? Assuming that we lock our row with "SELECT FOR UPDATE FROM WHERE ", how can we unlock it later? Do we have to put the whole thing in a transaction (which may be tricky fro= m=20 within a VB-Application...)? Thanks a lot, Markus