Re: relation ### modified while in use - Mailing list pgsql-hackers

From Hiroshi Inoue
Subject Re: relation ### modified while in use
Date
Msg-id 39F4D1D9.D449E871@tpf.co.jp
Whole thread Raw
In response to Re: relation ### modified while in use  (Alex Pilosov <alex@pilosoft.com>)
List pgsql-hackers

Philip Warner wrote:

> At 15:29 23/10/00 +0900, Hiroshi Inoue wrote:
> >
> >If we have a mechanism to acquire a share lock on a tuple,we
> >could use it for managing system info generally. However the
> >only allowed lock on a tuple is exclusive.  Access(Share/Exclusive)
> >Lock on tables would give us a restricted solution about pg_class
> >tuples.
> >
>
> 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?
>

Both RowShare and RowExclusive lock are table level
locking. The implementation of tuple level locking is
quite different from that of table level locking.
The information of table level locking is held in shared
memory. OTOH the information of tuple level locking
is held in the tuple itself i.e. a transaction(t_xmax) is
updating/deleting/selecting for update the tuple....
If other backends are about to update/delete/select
for update a tuple,they check the information of the
tuple and if the tuple is being updated/... they wait until
the end of the transaction(t_xmax).

Regards.
Hiroshi Inoue



pgsql-hackers by date:

Previous
From: "Horst Herb"
Date:
Subject: Re: [ANNC][RFC] crypto hashes for PostgreSQL 7.0, 7.1
Next
From: Hiroshi Inoue
Date:
Subject: BLERe: AW: AW: relation ### modified while in use