Re: table-level and row-level locks. - Mailing list pgsql-hackers

From Tom Lane
Subject Re: table-level and row-level locks.
Date
Msg-id 11887.1057936677@sss.pgh.pa.us
Whole thread Raw
In response to table-level and row-level locks.  ("Jenny -" <nat_lazy@hotmail.com>)
Responses Re: table-level and row-level locks.
List pgsql-hackers
"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> '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


pgsql-hackers by date:

Previous
From: "Maksim Likharev"
Date:
Subject: Re: [GENERAL] PG crash on simple query, story continues
Next
From: Sailesh Krishnamurthy
Date:
Subject: agg/order-by question