Re: Automatic transactions in SELECT...

From: Sergey Konoplev <gray(dot)ru(at)gmail(dot)com>
To: Tom Lisjac <netdxr(at)gmail(dot)com>
Cc: pgsql-novice <pgsql-novice(at)postgresql(dot)org>
Subject: Re: Automatic transactions in SELECT...
Date: 2013-02-09 03:28:55
Message-ID: CAL_0b1sj-yRZhBOM+qErXHhpxaTqs2CRYBowZ8c+TcuAG0hQ9A@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

On Fri, Feb 8, 2013 at 6:16 PM, Tom Lisjac <netdxr(at)gmail(dot)com> wrote:
> 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".
>
> That makes little sense and sounds like a dangling transaction, but in
> fairness I wanted to confirm that there isn't a set of defaults or flags
> that might cause the appearance of this behavior in version 9. I've been

I believe that the easiest way find out what is wrong is to ask the
programmer for more information of what exactly happens since the
start of the transaction and till the moment when it hangs.

He probably refers to the SELECTs that might occur during FK checks.
They look like this:

SELECT 1 FROM ONLY public.table1 x
WHERE $1 OPERATOR(pg_catalog.=) column
FOR SHARE OF x

If so than it make sense.

> unable to find any references on this and would greatly appreciate
> comments or pointers to docs that would help to clarify the issue.
>
> Thanks,
>
> -Tom
>
>
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice

--
Sergey Konoplev
Database and software architect
http://www.linkedin.com/in/grayhemp

Phones:
USA +1 415 867 9984
Russia, Moscow +7 901 903 0499
Russia, Krasnodar +7 988 888 1979

Skype: gray-hemp
Jabber: gray(dot)ru(at)gmail(dot)com

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lisjac 2013-02-09 04:00:17 Re: Automatic transactions in SELECT...
Previous Message Tom Lane 2013-02-09 03:23:10 Re: Automatic transactions in SELECT...