Re: Proposal: TRUNCATE TABLE table RESTRICT

Поиск
Список
Период
Сортировка
От Don Baccus
Тема Re: Proposal: TRUNCATE TABLE table RESTRICT
Дата
Msg-id 3.0.1.32.20000612165120.01172870@mail.pacifier.com
обсуждение исходный текст
Ответ на Re: Proposal: TRUNCATE TABLE table RESTRICT  (Mike Mascari <mascarm@mascari.com>)
Список pgsql-hackers
At 07:48 PM 6/12/00 -0400, Mike Mascari wrote:

>Actually, I was worried that if TRUNCATE were to vist all
>referring tables to determine whether or not it was empty, rather
>then just issuing an elog() at the first RI trigger encountered,
>that it might wind up scanning a 1,000,000 tuple relation (the
>referring relation) where all the rows have been marked as
>deleted before determining that its okay to perform the TRUNCATE.
>I was hoping that Oracle simply disallowed TRUNCATE on tables
>with referring relations, regardless of whether or not there was
>actually any data in them, so that PostgreSQL could do the same.
>:-)

Well, I think we probably could do so regardless of what Oracle
does.  Proper use of "on delete cascade" and "on delete set null"
etc would seem to make it more convenient to delete rows in a
set of related tables via delete rather than running around
trying to truncate them in the right order so that you
end up with empty tables before you delete the one with the
RI triggers on it.



- Don Baccus, Portland OR <dhogaza@pacifier.com> Nature photos, on-line guides, Pacific Northwest Rare Bird Alert
Serviceand other goodies at http://donb.photo.net.
 


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

Предыдущее
От: Mike Mascari
Дата:
Сообщение: Re: Proposal: TRUNCATE TABLE table RESTRICT
Следующее
От: Chris Bitmead
Дата:
Сообщение: Re: ALTER TABLE DROP COLUMN