Re: Are long term never commited SELECT statements are a problem? - Mailing list pgsql-sql

From Michael Fuhr
Subject Re: Are long term never commited SELECT statements are a problem?
Date
Msg-id 20050721151811.GA513@winnie.fuhr.org
Whole thread Raw
In response to Are long term never commited SELECT statements are a problem?  (Erik Wasser <erik.wasser@iquer.net>)
Responses Re: Are long term never commited SELECT statements are a problem?
List 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/


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: Can SELECT statements throw an error
Next
From: Erik Wasser
Date:
Subject: Re: Are long term never commited SELECT statements are a problem?