pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Chris Waters <chris.waters@networkchemistry.com>
To: pgsql-admin@postgresql.org
Subject: Fixing stale locks
Date: Sat, 14 Dec 2002 10:44:04 -0800
Message-ID: <atfu21$2qhv$1@news.hub.org> (raw)

Hi,

I am a new postresql user, but have done a lock of work with Oracle. I am
having a familiar problem with stale locks. I try to drop a table in psql
but the transaction hangs. I can abort the transaction with Ctl-C, but it
will never succeed.

My first instinct was a stale lock so I look in pg_locks and sure enough a
lock exists. Now the question is, how do I free this lock? This is just a
single machine installation and there are no processes running that could
hold the lock. I suspect it is from a process that crashed. Under Oracle we
used to just kill the pid that held the lock and the DB cleaned everything
up. When I tried that under postgresql my database crashed. Obviously the
PID column in the pg_locks table is for the server process, not the client
process :-(.

How do people normally deal with this type of problem?

Thanks,

Chris.

--
chris.waters@networkchemistry.com
www.networkchemistry.com





view thread (2+ messages)  latest in thread

Message-ID: <atfu21$2qhv$1@news.hub.org>
Permalink:  ../atfu21$2qhv$1@news.hub.org/
Also on:    postgresql.org/message-id/atfu21$2qhv$1@news.hub.org

 · 

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-admin@postgresql.org
  Cc: chris.waters@networkchemistry.com
  Subject: Re: Fixing stale locks
  In-Reply-To: <atfu21$2qhv$1@news.hub.org>
  References: <atfu21$2qhv$1@news.hub.org>

* 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