Re: TRUNCATE SERIALIZABLE and frozen COPY

Поиск
Список
Период
Сортировка
От Marti Raudsepp
Тема Re: TRUNCATE SERIALIZABLE and frozen COPY
Дата
Msg-id CABRT9RAy5Fcexfq6fVMJ=i7R4Q9Qr9sRjWaSZiewZ6Cxkcq6rA@mail.gmail.com
обсуждение исходный текст
Ответ на TRUNCATE SERIALIZABLE and frozen COPY  (Simon Riggs <simon@2ndQuadrant.com>)
Ответы Re: TRUNCATE SERIALIZABLE and frozen COPY  (Simon Riggs <simon@2ndquadrant.com>)
Список pgsql-hackers
On Wed, Nov 7, 2012 at 5:34 PM, Simon Riggs <simon@2ndquadrant.com> wrote:
> I was unhappy with changing the behaviour of TRUNCATE, and still am.
> So the proposal here is to have a specific modifier on TRUNCATE
> command that makes it MVCC safe by throwing a serialization error.
> That new behaviour should be requestable by adding the SERIALIZABLE
> keyword.
> i.e. TRUNCATE foo SERIALIZABLE;
> This then allows a new style of TRUNCATE, yet without modiying
> behaviour of earlier programs (ugh!).

Personally I think the behavior should be dictated by the *reader*.
The one doing the truncation may not know about the consistency
requirements of particular readers. Especially when you do the
truncate via pg_restore or some other generic tool. And indeed
different readers may have different consistency requirements.

So I'd prefer if it were a GUC variable; readers that accept relaxed
consistency can set truncate_conflict=off

Granted, making this part of the TRUNCATE statement does give you
table-level granularity. But if a reader can already handle
serialization conflicts, it doesn't really matter which table they
came from.

But making TRUNCATE behave in a MVCC-safe way, like proposed by Hannu,
would be much better.

Regards,
Marti



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

Предыдущее
От: Hannu Krosing
Дата:
Сообщение: Re: TRUNCATE SERIALIZABLE and frozen COPY
Следующее
От: Simon Riggs
Дата:
Сообщение: Re: TRUNCATE SERIALIZABLE and frozen COPY