X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 9B018D1DA3B for ; Thu, 28 Aug 2003 13:39:16 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 18556-01 for ; Thu, 28 Aug 2003 10:38:39 -0300 (ADT) Received: from sss.pgh.pa.us (unknown [192.204.191.242]) by svr1.postgresql.org (Postfix) with ESMTP id 67B5FD1B8B1 for ; Thu, 28 Aug 2003 10:38:33 -0300 (ADT) Received: from sss2.sss.pgh.pa.us (tgl@localhost [127.0.0.1]) by sss.pgh.pa.us (8.12.9/8.12.9) with ESMTP id h7SDcY5H010886; Thu, 28 Aug 2003 09:38:34 -0400 (EDT) To: =?iso-8859-2?Q?Daniel_Micha=B3?= Cc: pgsql-sql@postgresql.org Subject: Re: lock row in table In-reply-to: <002301c36d3d$baf7f1f0$2601a8c0@gliwice.helion.com.pl> References: <002301c36d3d$baf7f1f0$2601a8c0@gliwice.helion.com.pl> Comments: In-reply-to =?iso-8859-2?Q?Daniel_Micha=B3?= message dated "Thu, 28 Aug 2003 10:23:58 +0200" Date: Thu, 28 Aug 2003 09:38:33 -0400 Message-ID: <10885.1062077913@sss.pgh.pa.us> From: Tom Lane X-Virus-Scanned: by amavisd-new at postgresql.org X-Archive-Number: 200308/342 X-Sequence-Number: 14958 =?iso-8859-2?Q?Daniel_Micha=B3?= writes: > I have to lock one row in table1 for user1. In the same time other users sh= > ould be able to read this record but when other user for example user2 want= > to edit this record user2 should get information "The row you try to edit= > is currently edit" - or sometihing similar. > Of course I can lock record with syntax "Begin; select * from table1 where = > ID=3D12 for update; update table1 set field1=3D"New value" where ID=3D12; c= > ommit;" > but I can not to inform other user that the record is edited? Try using the contrib/userlock/ functions. regards, tom lane