pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Fixing stale locks
2+ messages / 2 participants
[nested] [flat]

* Fixing stale locks
@ 2002-12-14 18:44  Chris Waters <chris.waters@networkchemistry.com>
  0 siblings, 1 reply; 2+ messages in thread

From: Chris Waters @ 2002-12-14 18:44 UTC (permalink / raw)
  To: pgsql-admin

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





^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Fixing stale locks
@ 2002-12-15 05:27  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Chris Waters <chris.waters@networkchemistry.com>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2002-12-15 05:27 UTC (permalink / raw)
  To: Chris Waters <chris.waters@networkchemistry.com>; +Cc: pgsql-admin

"Chris Waters" <chris.waters@networkchemistry.com> writes:
> 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.

Oh?  Exactly what process does pg_locks show is holding the lock then?

> How do people normally deal with this type of problem?

Either you're misdescribing it, or it's not a normal type of problem.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2002-12-15 05:27 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2002-12-14 18:44 Fixing stale locks Chris Waters <chris.waters@networkchemistry.com>
2002-12-15 05:27 ` Tom Lane <tgl@sss.pgh.pa.us>

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