Re: about truncate

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: about truncate
Дата
Msg-id 16195.1230655806@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: about truncate  (Bruce Momjian <bruce@momjian.us>)
Ответы Re: about truncate  (Bruce Momjian <bruce@momjian.us>)
Re: about truncate  (David Fetter <david@fetter.org>)
Re: about truncate  (Peter Eisentraut <peter_e@gmx.net>)
Список pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> Peter Eisentraut wrote:
>> Considering that TRUNCATE is a pretty dangerous operation, how can we 
>> make adjustments to the behavior without upsetting lots of users?

> Well, it is one of those, "Either we fix it or live with the
> inconsistency forever".  Historically we have opted to fix it with a
> clear warning in the major release notes.

The only alternatives I can see are

(1) go ahead and change it.

(2) invent a separate "truncate_inheritance" GUC that is just like
"sql_inheritance" except it applies only for TRUNCATE.

Ugly as (2) is, I think it just puts off the pain.  Sooner or later
we'd want to flip the factory default from false to true, and the
release that does that is *still* going to burn anyone who's not
paying attention to the release notes.

My vote is to just go ahead and change it.  I don't really see much
of a use-case for truncating only the parent of an inheritance
hierarchy anyway, so I doubt that many people would be affected.

I note though that we have a lot of other non-recursive maintenance
operations (CLUSTER, some variants of ALTER TABLE, etc) ... are we
going to try to make them all recursive?
        regards, tom lane


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

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Hot standby and b-tree killed items
Следующее
От: "Alex Hunsaker"
Дата:
Сообщение: Re: contrib/pg_stat_statements 1226