Lock vs Update - Mailing list pgsql-sql

From Chairudin Sentosa Harjo
Subject Lock vs Update
Date
Msg-id 35D3EE21.E24F5F49@dnet.net.id
Whole thread Raw
In response to test subscribed  (Karin Probost <probost@uni-wuppertal.de>)
List pgsql-sql
Hi all,

I have a question regarding lock.
I want to update a table, so I want to make sure nobody else
is trying to update the same table, that's why I use lock.

What is the meaning of the NOTICE when I update the "mytable" ?

#########################################
mytable=> begin;
BEGIN

mytable=>lock table mytable;
DELETE 0

update mytable set status='INVALID' where number=12;
NOTICE: (transaction aborted): queries ignored until END
*ABORT STATE*
#########################################


I can only update the "mytable" after I type:

#########################################
mytable=> end;
END

mytable=> update mytable set status='INVALID' where number=12;
UPDATE 1
##########################################


Regards
Chai





pgsql-sql by date:

Previous
From: Karin Probost
Date:
Subject: test subscribed
Next
From: postgres@koma.net
Date:
Subject: ...