pg.ddx.io pgsql-sql@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Can a SELECT block? 2+ messages / 2 participants [nested] [flat]
* Can a SELECT block? @ 2001-03-29 00:10 Gerald Gutierrez <gutz@kalador.com> 0 siblings, 1 reply; 2+ messages in thread From: Gerald Gutierrez @ 2001-03-29 00:10 UTC (permalink / raw) To: pgsql-sql Hi all. I'm trying to track down a deadlock problem caused by some automatically generated SQL code. It seems I'm deadlocking on a table that is actually quite rarely modified. I'm unsure, but it appears that maybe something is blocking on a SELECT call. Under what situations can a SELECT block? I'm assuming that a simple INSERT probably cannot block anywhere. Under what situations, aside from two UPDATEs to the same row, can an UPDATE block? I'd appreciate any time. To give some details, it appears that my application server (Orion) is holding connections to the database, some of which are not in transactions, and some of which are "primed" for connections (meaning that a BEGIN is always issued, and waits till transactional work needs to be done, at which point it issues a COMMIT and then another BEGIN and waits again). It seems to always issue the command "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" after each BEGIN. I'd appreciate any help that anyone can give. Thanks. Gerald. ^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: Can a SELECT block? @ 2001-03-29 00:20 Tom Lane <tgl@sss.pgh.pa.us> parent: Gerald Gutierrez <gutz@kalador.com> 0 siblings, 0 replies; 2+ messages in thread From: Tom Lane @ 2001-03-29 00:20 UTC (permalink / raw) To: Gerald Gutierrez <gutz@kalador.com>; +Cc: pgsql-sql "Gerald Gutierrez" <gutz@kalador.com> writes: > Under what situations can a SELECT block? If the table is locked with an exclusive lock. See http://www.postgresql.org/devel-corner/docs/postgres/locking-tables.html > I'd appreciate any time. To give some details, it appears that my > application server (Orion) is holding connections to the database, some of > which are not in transactions, and some of which are "primed" for > connections (meaning that a BEGIN is always issued, and waits till > transactional work needs to be done, at which point it issues a COMMIT and > then another BEGIN and waits again). It seems to always issue the command > "SET TRANSACTION ISOLATION LEVEL READ COMMITTED" after each BEGIN. This would be somewhat annoying for VACUUM, which can only clean out tuples that went away before the oldest open transaction started. But offhand I think it does not matter for anything else. regards, tom lane ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2001-03-29 00:20 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2001-03-29 00:10 Can a SELECT block? Gerald Gutierrez <gutz@kalador.com> 2001-03-29 00:20 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox