Re: help with locked table(s)/transactions(s) - Mailing list pgsql-general

From Mott Leroy
Subject Re: help with locked table(s)/transactions(s)
Date
Msg-id 43DFE406.3040106@acadaca.com
Whole thread Raw
In response to Re: help with locked table(s)/transactions(s)  (Tom Lane <tgl@sss.pgh.pa.us>)
Responses Re: help with locked table(s)/transactions(s)  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-general
Tom Lane wrote:
> No, the ShareLock is the means used when transaction A needs to wait for
> transaction B to complete --- it tries to take a share lock on xact B's
> XID, which of course is blocked as along as B is holding its
> ExclusiveLock.  This is used when there is a row-update conflict, ie,
> A wants to lock or update a table row that B's already locked/updated.
> Unfortunately, in 7.4 there isn't any easy way to find out exactly which
> row transaction A is waiting on.

My function has a loop in it defined as:



FOR price_record IN select pd.price, sp.sku_id from sku_price as sp,
price_data as pd where sp.price_data_id = pd.price_data_id AND
pd.domain_id = LIVE LOOP

-- some selects and inserts

END LOOP;

Will postgres lock on all rows as it goes through this loop? Or can you
give me a better idea of what I can expect to be locked in my example?

Thanks a lot -

Mott


pgsql-general by date:

Previous
From: "Jim C. Nasby"
Date:
Subject: Re: Best way to handle table trigger on update
Next
From: Tom Lane
Date:
Subject: Re: help with locked table(s)/transactions(s)