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
---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings