Re: locks in CREATE TRIGGER, ADD FK

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: locks in CREATE TRIGGER, ADD FK
Дата
Msg-id 1707.1111552949@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: locks in CREATE TRIGGER, ADD FK  (Neil Conway <neilc@samurai.com>)
Ответы Re: locks in CREATE TRIGGER, ADD FK  (Neil Conway <neilc@samurai.com>)
Список pgsql-hackers
Neil Conway <neilc@samurai.com> writes:
> How can we drop the file at commit, given that a serializable 
> transaction's snapshot should still be able to see old relfilenode's 
> content?

It isn't 100% MVCC, I agree.  But it works because system catalog
lookups are SnapshotNow, and so when another session comes and wants to
look at the table it will see the committed new version of the pg_class
row pointing at the new relfilenode file.  What you have to prevent is
somebody accessing the table *while* the changeover happens ... and
that's why your lock has to be AccessExclusive.

If you want to complain about MVCC violations in CLUSTER, think about
the fact that it scans the table with SnapshotNow, and therefore loses
rows that are committed-dead but might still be visible to somebody.
        regards, tom lane


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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: swapping relfilenodes (was: Re: locks in CREATE TRIGGER,
Следующее
От: Tom Lane
Дата:
Сообщение: Re: swapping relfilenodes (was: Re: locks in CREATE TRIGGER,