Re: Yet another "drop table vs delete" question

Поиск
Список
Период
Сортировка
От Jeff Davis
Тема Re: Yet another "drop table vs delete" question
Дата
Msg-id 1240348510.26999.8.camel@monkey-cat.sm.truviso.com
обсуждение исходный текст
Ответ на Re: Yet another "drop table vs delete" question  (Christophe <xof@thebuild.com>)
Ответы Re: Yet another "drop table vs delete" question  (Christophe <xof@thebuild.com>)
Re: Yet another "drop table vs delete" question  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
On Tue, 2009-04-21 at 13:59 -0700, Christophe wrote:
> I'm sure there is a scenario under which a separate
> transaction could see non-MVCC behavior from TRUNCATE, but I'm
> having
> trouble see what it is.

Session1:
  BEGIN TRANSACTION ISOLATION LEVEL SERIALIZABLE;
  SELECT * FROM foo;

Session2:
  BEGIN;
  TRUNCATE bar;
  COMMIT;

Session1:
  SELECT * from bar;
  COMMIT;

In Session1, the serializable transaction sees an empty version of bar,
even though it had tuples in at the time Session1 got its serializable
snapshot.

If Session2 does a DROP TABLE instead of TRUNCATE, Session1 will get an
error when it tries to read "bar".

Regards,
    Jeff Davis


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

Предыдущее
От: Christophe
Дата:
Сообщение: Re: Yet another "drop table vs delete" question
Следующее
От: Christophe
Дата:
Сообщение: Re: Yet another "drop table vs delete" question