Re: [GENERAL] finding the other statement causing a sharelock

2010-11-09 Thread Dimitri Fontaine
Ivan Sergio Borgonovo writes: > I've some strong suspect... and I'd like to exit earlier from a > function if a process is running but I'm not really sure how to add a > semaphore... Maybe pg_try_advisory_lock() would help you there? http://www.postgresql.org/docs/8.3/static/explicit-locking.h

Re: [GENERAL] finding the other statement causing a sharelock

2010-11-08 Thread Ivan Sergio Borgonovo
On Mon, 8 Nov 2010 14:22:16 -0700 Scott Marlowe wrote: > Don't know how much it helps here, but this page: > http://wiki.postgresql.org/wiki/Lock_Monitoring > is priceless when you're having issues midday with a lock that > won't go away. I was thinking to reinvent the wheel and write something

Re: [GENERAL] finding the other statement causing a sharelock

2010-11-08 Thread Scott Marlowe
On Mon, Nov 8, 2010 at 2:18 PM, Ivan Sergio Borgonovo wrote: > On Mon, 08 Nov 2010 15:45:12 -0500 > Tom Lane wrote: > >> Ivan Sergio Borgonovo writes: >> > I get >> > DETAIL:  Process 24749 waits for ShareLock on transaction >> > 113443492; blocked by process 25199. Process 25199 waits for >> >

Re: [GENERAL] finding the other statement causing a sharelock

2010-11-08 Thread Ivan Sergio Borgonovo
On Mon, 08 Nov 2010 15:45:12 -0500 Tom Lane wrote: > Ivan Sergio Borgonovo writes: > > I get > > DETAIL: Process 24749 waits for ShareLock on transaction > > 113443492; blocked by process 25199. Process 25199 waits for > > ShareLock on transaction 113442820; blocked by process 24749. > > > I w

Re: [GENERAL] finding the other statement causing a sharelock

2010-11-08 Thread Tom Lane
Ivan Sergio Borgonovo writes: > I get > DETAIL: Process 24749 waits for ShareLock on transaction 113443492; > blocked by process 25199. Process 25199 waits for ShareLock on > transaction 113442820; blocked by process 24749. > I would like to know both statements that caused the sharelock > probl

[GENERAL] finding the other statement causing a sharelock

2010-11-08 Thread Ivan Sergio Borgonovo
I get DETAIL: Process 24749 waits for ShareLock on transaction 113443492; blocked by process 25199. Process 25199 waits for ShareLock on transaction 113442820; blocked by process 24749. I would like to know both statements that caused the sharelock problem. This is a long running transaction. I