Re: Waiting on a transaction

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Bill Moseley <moseley(at)hank(dot)org>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Waiting on a transaction
Date: 2005-08-16 18:25:25
Message-ID: 20050816182525.GD9432@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Villa 2005-08-16 18:54:29 Adding contrib modules
Previous Message Bill Moseley 2005-08-16 18:05:35 Waiting on a transaction