Re: Do we always have to update or insert? Why can't we just relate?

From: paul c <toledobythesea_at_oohay.ac>
Date: Tue, 18 Oct 2005 04:58:54 GMT
Message-ID: <ii%4f.216064$oW2.17092_at_pd7tw1no>


Marshall Spight wrote:
> Gene Wirchenko wrote:
>

>>Does including a fact twice make it more true?

>
>
> No. But asserting a fact twice doesn't make it *less* true,
> either, which is what the current behavior of insert says.
>
>
> Marshall
>

i'm with Marshall on this one - i'd rather just say 'assert' even if that word has special meaning for some debugging practices (same goes analogously for 'delete' for that matter). always better to say the right thing twice than the wrong thing once. 'INSERT OR UPDATE' always made sense to me, in fact, 'INSERT OR DELETE' wouldn't bother me.

i can't prove it but i suspect the typical INSERT behaviour is either an echo of the mainframe days (at least the ibm mf days) when disks and channels actually had some hardware support for keys (which many of the sql designers would have been at least unconsciously imbued of) or the mistaken foresight typical of many language designers who want to anticipate programmer errors. either way, even if i can't prove it, the language ends up preventing as many useful techniques as erroneous ones.

lots of times designers don't even realize how much they are influenced by historical baggage they are carrying around in their heads.

btw, i think Marshall didn't say that duplicate keys should be allowed.   it's been a long time since i wrote a channel program, but i vaguely remember that the ibm hw allowed duplicate keys in some circumstances (some of the access methods, eg. ISAM prevented dups in software) - maybe somebody could correct me if i'm remembering wrongly.

p Received on Tue Oct 18 2005 - 06:58:54 CEST

Original text of this message