Re: Waiting on a transaction - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Waiting on a transaction
Date
Msg-id 20050816182525.GD9432@svana.org
Whole thread Raw
In response to Waiting on a transaction  (Bill Moseley <moseley@hank.org>)
Responses Re: Waiting on a transaction  (Bill Moseley <moseley@hank.org>)
List pgsql-general
On Tue, Aug 16, 2005 at 11:05:35AM -0700, Bill Moseley wrote:
> I've read over the docs on Concurrency Control but still not clear
> about when transactions block other updates, and how to deal with that
> on the application level.
>
> If I do a BEGIN and an UPDATE in one psql session and then try and do
> an UPDATE in another psql session that UPDATE waits until either a
> COMMIT or ROLLBACK.
>
> Is it common for applications using Postgresql to set a timer on
> updates and abort?

It is not normal to hold a transaction open while doing nothing. If you
always send transactions without delays the issue doesn't come up
because you never have to wait long enough for it matter. If you want
to see the issues it causes, search the web for "idle in
transaction"...

There may be a timeout, I've never needed it though...

Hope this helps,
--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
> tool for doing 5% of the work and then sitting around waiting for someone
> else to do the other 95% so you can sue them.

Attachment

pgsql-general by date:

Previous
From: Bill Moseley
Date:
Subject: Waiting on a transaction
Next
From: "Jonathan Villa"
Date:
Subject: Adding contrib modules