Re: Relation Schemata vs. Relation Variables

From: <brian_at_selzer-software.com>
Date: 23 Aug 2006 17:33:06 -0700
Message-ID: <1156379586.122437.302270_at_b28g2000cwb.googlegroups.com>


Kenneth Downs wrote:
> Brian Selzer wrote:
>
> >
> > For instance, consider the following states for a relation describing
> > people's marital status, and a transition constraint that says: Single
> > people can't become Divorced:
> >
> > Current Proposed
> > Jane Jones Married Jane Jones Married
> > Jane Smith Single Jane Smith Divorced
>
> The schema does not contain enough information to validate marital status.
>
> For instance, if a person switches from single to divorced, do you reject it
> and have them call you an idiot because they are trying to correct a
> mistake?
>
> Or, do you put in some absurd requirement that the person change to married,
> then to divorced?
>
> Why not just record what you know? A table of claimed marital statuses with
> effective dates would detail the history of the claimed states, recording
> what you've been told and offering future investigation.
>

Because you can't define an enforcible transition constraint in terms of a single database state. Adding an additional relation to record claimed states just shifts the transition constraint from the one relation to the other, and nothing prevents a user from changing what has already been recorded. Let me try to be more clear. It is possible to issue an update that shouldn't be allowed. In your suggested solution, the user could simply replace the entry that indicated the last marital status, instead of adding an additional entry. This allows the user to circumvent the constraint. While in the above example you may want to allow that in order to correct a mistake, in an accounting environment, changes must often be tracible. So as an answer to your question above, you could modify the constraint above to allow an illegal change only if an explanation for the correction is recorded along with it, perhaps in another relation.

> P.S. the Catholic Church solves this problem the old fashioned way, with a
> single piece of paper per individual. If two people want to get married in
> parish A, the church secretary at Parish A sends the vital stats off to
> Church B, the groom's baptism church, and Church C, the bride's baptism
> church. After both have confirmed that neither are committing bigamy, they
> give the go-ahead.
>
> Sometimes I think it helps to remember that we are really just in the
> record-keeping business.
>
>
> --
> Kenneth Downs
> Secure Data Software, Inc.
> (Ken)nneth_at_(Sec)ure(Dat)a(.com)
Received on Thu Aug 24 2006 - 02:33:06 CEST

Original text of this message