Re: Add Missing From?

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Cc: Harald Fuchs <hf0722x(at)protecting(dot)net>
Subject: Re: Add Missing From?
Date: 2004-08-10 18:56:19
Message-ID: 200408101156.19796.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 Solutions
San Francisco

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2004-08-10 19:30:23 Why is WIN 1250 client only?
Previous Message Peter Eisentraut 2004-08-10 18:51:52 Re: Missing French backend translations in the HEAD