X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (av.hub.org [200.46.204.144]) by postgresql.org (Postfix) with ESMTP id 9DB449DCCA4 for ; Fri, 10 Mar 2006 16:50:19 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 51438-01 for ; Fri, 10 Mar 2006 16:50:20 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey- Received: from server114.midphase.com (server114.midphase.com [66.225.255.59]) by postgresql.org (Postfix) with ESMTP id 43B919DCCC8 for ; Fri, 10 Mar 2006 16:50:17 -0400 (AST) Received: from [200.161.74.107] (helo=Pragya01) by server114.midphase.com with smtp (Exim 4.52) id 1FHoZ0-0004Ek-Ox for pgsql-sql@postgresql.org; Fri, 10 Mar 2006 14:50:19 -0600 From: =?us-ascii?Q?Flavio_Suguimoto?= To: Subject: Locking row Date: Fri, 10 Mar 2006 17:50:10 -0300 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) In-Reply-To: <20060310173113.GA8935@wolff.to> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2900.2180 Importance: Normal X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - server114.midphase.com X-AntiAbuse: Original Domain - postgresql.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - pragyatechnologies.com X-Source: X-Source-Args: X-Source-Dir: X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, score=0.12 required=5 tests=[AWL=0.120, FROM_EXCESS_QP=0] X-Spam-Score: 0.12 X-Spam-Level: X-Archive-Number: 200603/152 X-Sequence-Number: 24498 Hi all, I need to mark a row with a value in a column, but first i need to select the first row without this mark. But in some concurrents cases i mark the row twice. How can i lock the row to avoid others session get it? TABLE TICKET TICKET_NUMBER | MARK 00001 | 1 00002 | 0 I need to select the first row with 0 in MARK column and then mark it with 1. regards, Flavio Suguimoto