Received: from localhost (postgresql.org [64.49.215.8]) by postgresql.org (Postfix) with ESMTP id 85A8847590C for ; Sat, 14 Dec 2002 13:42:10 -0500 (EST) Received: from news.hub.org (news.hub.org [64.49.215.80]) by postgresql.org (Postfix) with ESMTP id 1C1CB4758E6 for ; Sat, 14 Dec 2002 13:42:10 -0500 (EST) Received: by news.hub.org (Postfix, from userid 8) id F18A443AF44; Sat, 14 Dec 2002 13:42:09 -0500 (EST) From: "Chris Waters" X-Newsgroups: comp.databases.postgresql.admin Subject: Fixing stale locks Date: Sat, 14 Dec 2002 10:44:04 -0800 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 27 Message-ID: X-Complaints-To: usenet@news.hub.org X-Priority: 3 X-MSMail-Priority: Normal X-Newsreader: Microsoft Outlook Express 6.00.2600.0000 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2600.0000 To: pgsql-admin@postgresql.org X-Virus-Scanned: by AMaViS new-20020517 X-Archive-Number: 200212/192 X-Sequence-Number: 6687 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