pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chairudin Sentosa Harjo <chai@dnet.net.id>
To: pgsql-sql@postgreSQL.org
Subject: Lock vs Update
Date: Fri, 14 Aug 1998 14:58:26 +0700
Message-ID: <35D3EE21.E24F5F49@dnet.net.id> (raw)
References: <35D3E604.F387CD6F@uni-wuppertal.de>

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







Message-ID: <35D3EE21.E24F5F49@dnet.net.id>
Permalink:  ../35D3EE21.E24F5F49@dnet.net.id/
Also on:    postgresql.org/message-id/35D3EE21.E24F5F49@dnet.net.id

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: chai@dnet.net.id
  Subject: Re: Lock vs Update
  In-Reply-To: <35D3EE21.E24F5F49@dnet.net.id>
  References: <35D3E604.F387CD6F@uni-wuppertal.de> <35D3EE21.E24F5F49@dnet.net.id>

* 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