Search Postgresql Archives

Re: database locks

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Tomasz Rakowski wrote:
> I'm facing frustrating problem with locking in
> postgres server. I have application which do update
> one table few thousands time each minute. From time to
> time call to database is locked and is waiting for something 
> (In pgAdmin3 in 'Server Status' window in 'Lock' tab I
> can see UPDATE statement siting there for hours... and
> usually it is the the only lock! ) At the same time I
> can connect to database from other applications
> (including pgAdmin3) and do any query on that table.

SELECT statements are never blocked by row locks, so the
latter is not surprising.

The first step is probably to find out what holds the lock for
such a long time:

When the hang occurs, do a 'SELECT * FROM pg_locks', that should
show you which backend is waiting for the lock and which backend
holds it. If you have stats_command_string set to on, you will
see the executing statement in pg_stat_activity.

Yours,
Laurenz Albe


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux