Re: relation ### modified while in use

Поиск
Список
Период
Сортировка
От Philip Warner
Тема Re: relation ### modified while in use
Дата
Msg-id 3.0.5.32.20001024020421.03265410@mail.rhyme.com.au
обсуждение исходный текст
Ответ на Re: relation ### modified while in use  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: relation ### modified while in use  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-hackers
At 10:45 23/10/00 -0400, Tom Lane wrote:
>Philip Warner <pjw@rhyme.com.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   |/


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: relation ### modified while in use
Следующее
От: Jan Wieck
Дата:
Сообщение: Re: [GENERAL] Re: My new job