Re: Weird lock or bug maybe? - Mailing list pgsql-general

From Richard Huxton
Subject Re: Weird lock or bug maybe?
Date
Msg-id 42F34566.30902@archonet.com
Whole thread Raw
In response to Weird lock or bug maybe?  (Ben-Nes Yonatan <da@canaan.co.il>)
Responses Re: Weird lock or bug maybe?  (Ben-Nes Yonatan <nimrod@canaan.co.il>)
List pgsql-general
Ben-Nes Yonatan wrote:

> If ill query: DELETE FROM table1;  it will just get stuck...
> If ill try: DELETE FROM table1 WHERE table1_id=1523; it will work in
> most cases but for some rows it will just get stuck!
> Anyone know anything about this weird problem?
> By the way when I restarted the DB server I was able to delete the
> current row which stucked the process but then I got stuck at some other
> row at the table....

What do you mean by "get stuck"?
Are you sure it's not scanning one of the tables to check references
before deleting? If you don't have an index on the table in question
then PG will have to scan the entire table.

To check for locks, try:
SELECT * FROM pg_stat_activity;
SELECT * FROM pg_locks;

Let's see what's actually happening.
--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: Does preparing statements other than selects help performance?
Next
From: Richard Huxton
Date:
Subject: Re: Weird lock or bug maybe?