Thread: Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
Strange deadlock problem on simple concurrent SELECT/LOCK TABLE transactions
From
Tomasz Zielonka
Date:
Hi! I'm using PostgreSQL 7.1.3 on Intel PIII, Linux 2.4.8, Slackware 8.0, compiled with egcs 2.91.66 (the same on 7.1.2 / 2.95.3). I'm encountering very strange deadlock situation. Strange, because after this deadlock occurs, even with no active postgres processes (postmaster only), when I connect with psql I can't select anything from affected table. Here is a (almost) minimal test: CREATE TABLE items ( id INTEGER NOT NULL, amount FLOAT NOT NULL, PRIMARY KEY (id) ); -- amount field is probably no longer necessary, but I haven't tested without -- it And run this in TWO concurrent sessions: $ yes 'begin; select * from items; lock table items; commit;' | psql I get deadlock here quite fast. Both processes freeze on next select. Stop them (ctrl-c). ps xa shows only postmaster process, no postgres ones. Now connect which psql and try to 'SELECT * FROM items'. Freeze again. What do you think? Have a nice weekend :) Greetings, Tom -- .signature: Too many levels of symbolic links