pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: Daniel MichaƂ <danielosch@o2.pl>
Cc: pgsql-sql@postgresql.org
Subject: Re: lock row in table
Date: Thu, 28 Aug 2003 09:38:33 -0400
Message-ID: <10885.1062077913@sss.pgh.pa.us> (raw)
In-Reply-To: <002301c36d3d$baf7f1f0$2601a8c0@gliwice.helion.com.pl>
References: <002301c36d3d$baf7f1f0$2601a8c0@gliwice.helion.com.pl>

=?iso-8859-2?Q?Daniel_Micha=B3?= <danielosch@o2.pl> 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



view thread (4+ messages)

Message-ID: <10885.1062077913@sss.pgh.pa.us>
Permalink:  ../10885.1062077913@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/10885.1062077913@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: tgl@sss.pgh.pa.us, danielosch@o2.pl
  Subject: Re: lock row in table
  In-Reply-To: <10885.1062077913@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox