Iam trying to acquire rowlevel locks in postgresql. I try doing this: 
 'select * from students where name='Larry' for update;
But by looking at the holding array of proclock , I've noticed that by doing this only 
AccessShareLock gets acquired which is a table level lock. 
How do I acquire rowlevelock and what fields of Lock or Proclock datastructures indicate it.
Thanks
JennyMSN 8 with e-mail virus protection service:  2 months FREE*

Thu, 10 Jul 2003 08:46:55 -0700
"Jenny -" <nat_lazy@hotmail.com>
table-level and row-level locks.
"Jenny -" <nat_lazy@hotmail.com> writes:
> <html><div style='background-color:'><DIV>Iam trying to acquire rowlevel locks in postgresql. I try doing this: </DIV>
> <DIV>&nbsp;'select * from students where name='Larry' for update;</DIV>
> <DIV>But by looking at the holding array of proclock , I've noticed that by doing this only 
> <DT>AccessShareLock gets acquired which is a table level lock. </DT>

Please do not use HTML mail on this list ...

Anyway, the answer to your question is that row locks are recorded on
disk (by marking the tuple as locked).  We'd soon run out of memory
if we tried to record them in the shared lock table.

			regards, tom lane

Fri, 11 Jul 2003 11:17:57 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: table-level and row-level locks. 
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

Wed, 20 Aug 2003 14:45:23 -0400
Tom Lane <tgl@sss.pgh.pa.us>
Re: table-level and row-level locks. 