Re: Select max(id) causes AccessExclusiveLock?

From: Stephen Frost <sfrost(at)snowman(dot)net>
To: Edson Richter <edsonrichter(at)hotmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Select max(id) causes AccessExclusiveLock?
Date: 2014-04-28 17:30:29
Message-ID: 20140428173029.GL2556@tamriel.snowman.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Edson,

* Edson Richter (edsonrichter(at)hotmail(dot)com) wrote:
> The programmer added a
>
> LOCK TABLE MyTableName
>
> just before issuing the select max(id) from MyTableName.
>
> I do suspect this is the case, right?

Yup, that'll do it.

http://www.postgresql.org/docs/9.3/static/sql-lock.html

Thanks,

Stephen

In response to

Browse pgsql-general by date

  From Date Subject
Next Message David Ekren 2014-04-28 19:15:48 xml question
Previous Message Edson Richter 2014-04-28 16:53:51 Re: Select max(id) causes AccessExclusiveLock?