Re: Add Missing From?

Поиск
Список
Период
Сортировка
От Josh Berkus
Тема Re: Add Missing From?
Дата
Msg-id 200408101156.19796.josh@agliodbs.com
обсуждение исходный текст
Ответ на Add Missing From?  (Josh Berkus <josh@agliodbs.com>)
Список pgsql-hackers
Harald,

> You're talking about "the deletion target table".  Sorry to mention
> the M word again, but MySQL allows deleting from more than one table
> at the same time.  Should we support that?

Nope.   In fact, I'd argue pretty strongly against any move to do so.

MySQL supports multi-table delete for 2 reasons:
1) MySQL does not support CASCADE Foriegn Keys, and as a result this is the
only way they can "clean out" all related records.
2) To be blunt: MySQL doesn't care about your data.  Just look at their
implementation of constraints.

Since we do support CASCADE FKs, there is no reason for us to support this
syntax; just set your FKs up correctly and it's taken care of.   Were we to
consider implementing this, the implementors would have to answer the
following questions:

A) In what order are the rows deleted, from which table first?
B) If no join criteria are supplied, is it OK to delete all rows from one of
the tables?  If not, how do you deliberately clean out a table?
C) If one of the tables had FKs or triggers that affect one of the other
tables, when do these get evaluated/fired?

Overall, I consider it a very, very bad idea.

--
-Josh Berkus"A developer of Very Little Brain"Aglio Database SolutionsSan Francisco



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

Предыдущее
От: Peter Eisentraut
Дата:
Сообщение: Why is WIN 1250 client only?
Следующее
От: Peter Eisentraut
Дата:
Сообщение: Re: Missing French backend translations in the HEAD