Re: Are long term never commited SELECT statements are a problem?

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Erik Wasser <erik(dot)wasser(at)iquer(dot)net>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Are long term never commited SELECT statements are a problem?
Date: 2005-07-21 15:18:11
Message-ID: 20050721151811.GA513@winnie.fuhr.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On Thu, Jul 21, 2005 at 03:57:56PM +0200, Erik Wasser wrote:
> Now I've got here a blocking problem. Severel SQL statements (like
> renaming a field or UPDATE of a field) are blocked until I kill a
> certain task. This task DOES only the INSERTS and UPDATES with a
> transaction and the SELECT statements are not within an transaction.

If you set AutoCommit to 0 then all statements are inside a
transaction. As you've discovered, SELECT acquires certain locks
that persist for the duration of the transaction, so you must commit
or roll back the transaction to release those locks (read up on
transaction theory to learn more about the rationale for this).

--
Michael Fuhr
http://www.fuhr.org/~mfuhr/

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Erik Wasser 2005-07-21 15:40:57 Re: Are long term never commited SELECT statements are a problem?
Previous Message Tom Lane 2005-07-21 14:35:26 Re: Can SELECT statements throw an error