Re: Automatic transactions in SELECT...

Поиск
Список
Период
Сортировка
От Thomas Kellerer
Тема Re: Automatic transactions in SELECT...
Дата
Msg-id kf53ki$ot2$1@ger.gmane.org
обсуждение исходный текст
Ответ на Automatic transactions in SELECT...  (Tom Lisjac <netdxr@gmail.com>)
Ответы Re: Automatic transactions in SELECT...  (Tom Lisjac <netdxr@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: Tom Lisjac
Дата:
Сообщение: Re: Automatic transactions in SELECT...
Следующее
От: Tom Lisjac
Дата:
Сообщение: Re: Automatic transactions in SELECT...