Re: Automatic transactions in SELECT... - Mailing list pgsql-novice

From Thomas Kellerer
Subject Re: Automatic transactions in SELECT...
Date
Msg-id kf53ki$ot2$1@ger.gmane.org
Whole thread Raw
In response to Automatic transactions in SELECT...  (Tom Lisjac <netdxr@gmail.com>)
Responses Re: Automatic transactions in SELECT...  (Tom Lisjac <netdxr@gmail.com>)
List pgsql-novice
Tom Lisjac wrote on 09.02.2013 03:16:
> We're in the process of deploying 9.2.1 to support an internal
> application we've been working on for the last few months. One of our
> programmers has recently complained that we get occasional hangs because
> "postgres automatically runs SELECT statements in a transaction that
> requires an explicit commit".

This behaviour is true for most (if not all) DBMS - defintely for Oracle, SQL Server and MySQL.

If no transaction is active, _any_ (DML) statement (including SELECT) will start a new transaction.
This can either be controlled via explicit transaction handling (BEGIN ... END) or the
autocommit property of the connection.

What exactly are those "occasional hangs"? How do they manifest themselves?

The select doesn't lock the rows that were selected (unless a FOR UPDATE was used).

Regards
Thomas


pgsql-novice by date:

Previous
From: Tom Lisjac
Date:
Subject: Re: Automatic transactions in SELECT...
Next
From: Tom Lisjac
Date:
Subject: Re: Automatic transactions in SELECT...