Fixing stale locks 
Author Message
 Fixing stale locks

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.

--

www.networkchemistry.com



Thu, 02 Jun 2005 02:44:04 GMT
 Fixing stale locks

Quote:

> 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?

Quote:
> 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

---------------------------(end of broadcast)---------------------------



Thu, 02 Jun 2005 13:27:24 GMT
 
 [ 2 post ] 

 Relevant Pages 

1. stale lock files

2. how to remove stale locks ?

3. recordset.Edit() Locking vs. Stale Data

4. Re-Indexing blocked by stale connections holding locks

5. LOCK Fixes/Break on FreeBSD 4.2-STABLE

6. LOCK Fixes/Break on FreeBSD 4.2-STABLE

7. Error 10 - Locked Array or Fixed

8. Run-time error 10 - This array is fixed or temproarily locked

9. LOCK Fixes/Break on FreeBSD 4.2-STABLE

10. I set locks too high, How do I fix it

11. Error 10 - Locked Array or Fixed

12. v$logfile.state=INVALID/STALE?


 
Powered by phpBB® Forum Software