Re: relation ### modified while in use

From: Philip Warner <pjw(at)rhyme(dot)com(dot)au>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Hiroshi Inoue <Inoue(at)tpf(dot)co(dot)jp>, Alex Pilosov <alex(at)pilosoft(dot)com>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: relation ### modified while in use
Date: 2000-10-23 16:04:21
Message-ID: 3.0.5.32.20001024020421.03265410@mail.rhyme.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

At 10:45 23/10/00 -0400, Tom Lane wrote:
>Philip Warner <pjw(at)rhyme(dot)com(dot)au> writes:
>> Don't we have this ability? What about taking a RowShare lock on the
>> pg_class tuple whenever you read from the table; then requiring schema
>> updates take a RowExclusive lock on the pg_class tuple?
>
>How is that different from taking locks on the table itself?

Only slightly; one interpretation of a table lock is that it locks all of
the data in the table; and a lock on the pg_class row locks the metadata. I
must admit that I am having a little difficulty thinking of a case where
the distinction would be useful...

>In any case, we don't have the ability to hold multiple classes of locks
>on individual tuples, AFAIK. UPDATE and SELECT FOR UPDATE use a
>different mechanism that involves setting fields in the header of the
>affected tuple. There's no room there for more than one kind of lock;
>what's worse, checking and waiting for that lock is far slower than
>normal lock-manager operations.

So where do

SELECT FOR UPDATE IN ROW SHARE MODE
and
LOCK TABLE IN ROW EXCLUSIVE MODE statements.

fit in?

They *seem* to provide differing levels of row locking.

----------------------------------------------------------------
Philip Warner | __---_____
Albatross Consulting Pty. Ltd. |----/ - \
(A.B.N. 75 008 659 498) | /(@) ______---_
Tel: (+61) 0500 83 82 81 | _________ \
Fax: (+61) 0500 83 82 82 | ___________ |
Http://www.rhyme.com.au | / \|
| --________--
PGP key available upon request, | /
and from pgp5.ai.mit.edu:11371 |/

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2000-10-23 16:19:41 Re: Add support for <xti.h>
Previous Message Vince Vielhaber 2000-10-23 15:50:43 Re: [HACKERS] RE: Announcing PgSQL - a Python DB-API 2.0 compliant interface to PostgreSQLL