Thread: table-level and row-level locks.

table-level and row-level locks.

From
"Jenny -"
Date:
<div style="background-color:"><div><div><div><div><div><div><div>Iam trying to acquire rowlevel locks in postgresql. I
trydoing this: </div><div> 'select * from students where name='Larry' for update;</div><div>But by looking at the
holdingarray of proclock , I've noticed that by doing this only <dl><dt>AccessShareLock gets acquired which is a table
levellock. <dt>How do I acquire rowlevelock and what fields of Lock or Proclock datastructures indicate
it.<dt>Thanks<dt>Jenny</dl></div></div></div></div></div></div></div></div><brclear="all" /><hr />MSN 8 helps <a
href="http://g.msn.com/8HMVENUS/2752??PS=">ELIMINATEE-MAIL VIRUSES.</a> Get 2 months FREE*. 

Re: table-level and row-level locks.

From
Sailesh Krishnamurthy
Date:
Once more unto the breach -
   Could you please abstain from sending HTML email to the list ?    Many thanks !

-- 
Pip-pip
Sailesh
http://www.cs.berkeley.edu/~sailesh




Re: table-level and row-level locks.

From
"Jenny -"
Date:
>A row lock is represented by storing the locking transaction's ID in
>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.

Where is 'xmax' found? is it at code level or on disk?
thanks
Jenny


>From: Tom Lane <tgl@sss.pgh.pa.us>
>To: suzukikui@nttdata.co.jp
>CC: pgsql-hackers@postgresql.org
>Subject: Re: [HACKERS] table-level and row-level locks. Date: Wed, 20 Aug 
>2003 14:45:23 -0400
>
>Koichi Suzuki <suzukikui@nttdata.co.jp> writes:
> > I need to know where such "lock marks" are stored in the source level.
>
>A row lock is represented by storing the locking transaction's ID in
>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.  The bit is
>needed to distinguish this from the case where the transaction is
>deleting the tuple.
>
>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html

_________________________________________________________________
Get MSN 8 and help protect your children with advanced parental controls.  
http://join.msn.com/?page=features/parental



Re: table-level and row-level locks.

From
"Jenny -"
Date:
if table and page are locked in src/backend/storage/lmgr/lmgr.c by 
LockRelation() and LockPage respectively, in which file and by which 
function is a row locked?
thanks
Jenny


>From: "Jenny -" <nat_lazy@hotmail.com>
>To: pgsql-hackers@postgresql.org
>Subject: Re: [HACKERS] table-level and row-level locks.
>Date: Sun, 24 Aug 2003 11:30:41 -0700
>
>>A row lock is represented by storing the locking transaction's ID in
>>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.
>
>Where is 'xmax' found? is it at code level or on disk?
>thanks
>Jenny
>
>
>>From: Tom Lane <tgl@sss.pgh.pa.us>
>>To: suzukikui@nttdata.co.jp
>>CC: pgsql-hackers@postgresql.org
>>Subject: Re: [HACKERS] table-level and row-level locks. Date: Wed, 20 Aug 
>>2003 14:45:23 -0400
>>
>>Koichi Suzuki <suzukikui@nttdata.co.jp> writes:
>> > I need to know where such "lock marks" are stored in the source level.
>>
>>A row lock is represented by storing the locking transaction's ID in
>>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.  The bit is
>>needed to distinguish this from the case where the transaction is
>>deleting the tuple.
>>
>>            regards, tom lane
>>
>>---------------------------(end of broadcast)---------------------------
>>TIP 5: Have you checked our extensive FAQ?
>>
>>                http://www.postgresql.org/docs/faqs/FAQ.html
>
>_________________________________________________________________
>Get MSN 8 and help protect your children with advanced parental controls.  
>http://join.msn.com/?page=features/parental
>
>
>---------------------------(end of broadcast)---------------------------
>TIP 8: explain analyze is your friend

_________________________________________________________________
MSN 8: Get 6 months for $9.95/month. http://join.msn.com/?page=dept/dialup



Re: table-level and row-level locks.

From
"Jenny -"
Date:
>A row lock is represented by storing the locking transaction's ID in
>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.  The bit is
>needed to distinguish this from the case where the transaction is
>deleting the tuple.

where is 'HEAP_MARKED_FOR_UPDATE infomask bit' found ?
thanks


>From: Tom Lane <tgl@sss.pgh.pa.us>
>To: suzukikui@nttdata.co.jp
>CC: pgsql-hackers@postgresql.org
>Subject: Re: [HACKERS] table-level and row-level locks. Date: Wed, 20 Aug 
>2003 14:45:23 -0400
>
>Koichi Suzuki <suzukikui@nttdata.co.jp> writes:
> > I need to know where such "lock marks" are stored in the source level.
>
>A row lock is represented by storing the locking transaction's ID in
>xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.  The bit is
>needed to distinguish this from the case where the transaction is
>deleting the tuple.
>
>            regards, tom lane
>
>---------------------------(end of broadcast)---------------------------
>TIP 5: Have you checked our extensive FAQ?
>
>                http://www.postgresql.org/docs/faqs/FAQ.html

_________________________________________________________________
Use custom emotions -- try MSN Messenger 6.0! 
http://www.msnmessenger-download.com/tracking/reach_emoticon



Re: table-level and row-level locks.

From
Alvaro Herrera
Date:
On Sun, Sep 07, 2003 at 04:07:42PM -0700, Jenny - wrote:
> >A row lock is represented by storing the locking transaction's ID in
> >xmax and setting the HEAP_MARKED_FOR_UPDATE infomask bit.  The bit is
> >needed to distinguish this from the case where the transaction is
> >deleting the tuple.
> 
> where is 'HEAP_MARKED_FOR_UPDATE infomask bit' found ?

Have you ever heard of the "grep" *nix utility?  It's quite useful.

Anyway, t_infomask is part of a struct called HeapTupleHeaderData,
defined somewhere in src/include/access/htup.h

-- 
Alvaro Herrera (<alvherre[a]dcc.uchile.cl>)
You liked Linux a lot when he was just the gawky kid from down the block
mowing your lawn or shoveling the snow. But now that he wants to date
your daughter, you're not so sure he measures up. (Larry Greenemeier)