Re: [GENERAL] SELECT and RowExclusiveLock - Mailing list pgsql-general

From David G. Johnston
Subject Re: [GENERAL] SELECT and RowExclusiveLock
Date
Msg-id CAKFQuwbHo=GYUm30+uAVRDBW+MsiEk9LyBV=2BKR-CybG=2ZvQ@mail.gmail.com
Whole thread Raw
In response to [GENERAL] SELECT and RowExclusiveLock  (Tim Nelson <timnels@gmail.com>)
List pgsql-general
On Fri, Apr 7, 2017 at 1:25 PM, Tim Nelson <timnels@gmail.com> wrote:
New to Postgres and I have never seen this condition.  We are getting test applications hanging on SELECT statements with a RowExclusiveLock.  How can a SELECT cause a RowExclusiveLock?

Two common ways:

SELECT ... FOR UPDATE;

SELECT function_that_performs_updates();

There are some more moving parts here, especially transactions, that may be coming into play.  Its hard to say more given the limited and partial detail.  Version and a more complete pg_stat_activity query would be helpful.

David J.

pgsql-general by date:

Previous
From: Adrian Klaver
Date:
Subject: Re: [GENERAL] SELECT and RowExclusiveLock
Next
From: John Iliffe
Date:
Subject: [GENERAL] Unable to connect to Postgresql