Search Postgresql Archives

Re: help with locked table(s)/transactions(s)

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

 



Mott Leroy <mott@xxxxxxxxxxx> writes:
> I'm still confused by the behavior however. The locking behaves as if 
> its some kind of *table* level lock, because while the function is 
> executing (a long time), a dozen updates and inserts build up waiting 
> for some lock to be released. If the loop just occassionally puts a lock 
> on a few different rows, I don't see how that could cause the 
> experienced behavior -- presumably the lock on those particular rows is 
> released after its iteration through the loop. Unless, of course, the 
> lock isn't given up ...

No, the locks would be held till end of transaction.  It is a little odd
that you have so many conflicts, though, unless the referenced table is
pretty small and/or this loop manages to touch a large fraction of the
possible keys.

			regards, tom lane


[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