pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Alban Hertroys <alban@magproductions.nl>
To: Jenny <jenny_tania@yahoo.com>
Cc: pgsql-general@postgresql.org
Subject: Re: need help
Date: Tue, 06 Dec 2005 11:45:48 +0100
Message-ID: <43956BDC.6070704@magproductions.nl> (raw)
In-Reply-To: <20051206083838.90175.qmail@web31508.mail.mud.yahoo.com>
References: <20051206083838.90175.qmail@web31508.mail.mud.yahoo.com>

Jenny wrote:
> I'm running PostgreSQL 8.0.3 on i686-pc-linux-gnu (Fedora Core 2). I've been
> dealing with Psql for over than 2 years now, but I've never had this case
> before.

> Then I try to run the query from the psql shell. For example, the table has
> obat_id : A, B, C, D.
> db=# UPDATE s_apotik SET stock = 100 WHERE obat_id='A';
> (.... nothing happens.. I press the Ctrl-C to stop it. This is what comes out
> :)
> Cancel request sent
> ERROR: canceling query due to user request
> 
> (If I try another obat_id)
> db=# UPDATE s_apotik SET stock = 100 WHERE obat_id='B';
> (Less than a second, this is what comes out :)
> UPDATE 1

It could well be another client has a lock on that record, for example 
by doing a SELECT FOR UPDATE w/o a NOWAIT.

You can verify by querying pg_locks. IIRC you can also see what query 
caused the lock by joining against some other system table, but the 
details escape me atm (check the archives, I learned that by following 
this list).

If it's indeed a locked record, the process causing the lock is listed. 
Either kill it or call it's owner back from his/her coffee break ;)

I doubt it's anything serious.

-- 
Alban Hertroys
alban@magproductions.nl

magproductions b.v.

T: ++31(0)534346874
F: ++31(0)534346876
M:
I: www.magproductions.nl
A: Postbus 416
    7500 AK Enschede

//Showing your Vision to the World//



view thread (35+ messages)  latest in thread

Message-ID: <43956BDC.6070704@magproductions.nl>
Permalink:  ../43956BDC.6070704@magproductions.nl/
Also on:    postgresql.org/message-id/43956BDC.6070704@magproductions.nl

 · 

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: alban@magproductions.nl, jenny_tania@yahoo.com, pgsql-general@postgresql.org
  Subject: Re: need help
  In-Reply-To: <43956BDC.6070704@magproductions.nl>

* 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