Skip site navigation (1) Skip section navigation (2)

Re: Problem with table lock within a function

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Daniel Cristian Cruz <danielcristian(at)gmail(dot)com>
Cc: pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Problem with table lock within a function
Date: 2009-04-08 20:02:31
Message-ID: 18318.1239220951@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-admin
Daniel Cristian Cruz <danielcristian(at)gmail(dot)com> writes:
> sgn=# SELECT * FROM pg_locks WHERE relation = 1706665;
>  locktype | database | relation | page | tuple | transactionid | classid |
> objid | objsubid | transaction |  pid  |        mode         | granted
> ----------+----------+----------+------+-------+---------------+---------+-------+----------+-------------+-------+---------------------+---------
>  relation |  1705022 |  1706665 |      |       |               |
> |       |          |   160721874 | 25743 | AccessExclusiveLock | f

> What could be wrong? How could I get an access share lock only using select?

Whatever is trying to take that AccessExclusiveLock is most certainly
not "only using select".  Have you looked into pg_stat_activity to
try to see what it *is* doing?

			regards, tom lane

In response to

pgsql-admin by date

Next:From: Daniel Cristian CruzDate: 2009-04-08 20:02:57
Subject: Re: Problem with table lock within a function
Previous:From: Daniel Cristian CruzDate: 2009-04-08 19:38:50
Subject: Problem with table lock within a function

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group