Re: Proving an Upgrade is Possible
From: Jan Hidders <jan.hidders_at_REMOVETHIS.pandora.be>
Date: Tue, 07 Jun 2005 21:36:16 GMT
Message-ID: <krope.113585$0R6.6573102_at_phobos.telenet-ops.be>
>
> To provide an analytic and deterministic answer to the viability of any db
> change, you must consider constraints, null rules, and defaults.
>
> Consider this case. Add two columns to a table, COL_A and COL_B, with the
> constraint that COL_A < COL_B. One has a default value, the other does
> not, and they may not be null. What on Earth do you do to satisfy these
> requirements in the rows that already exist in the table?
Date: Tue, 07 Jun 2005 21:36:16 GMT
Message-ID: <krope.113585$0R6.6573102_at_phobos.telenet-ops.be>
Kenneth Downs wrote:
> Jan Hidders wrote:
>>Kenneth Downs wrote: >>>Jan Hidders wrote: >>> >>>>Ok, so I suspect are you asking the following: >>>> >>>>"Given the old database schema and a few updates to its constraints (but >>>>not its structure) is it possible to algorithmically decide (or >>>>mathematically prove) whether all instances of the old schema are also >>>>instances of the new schema?" >>>> >>>>I leave it to you whether it is "algorithmically decide" or >>>>"mathematically prove". >>> >>>You are on target, except that constraints are included, and also >>>automation >>>(columns like price_extended = price * qty). So while we are at it, this >>>means things like NULL/NOT NULL rules, DEFAULT values and so forth. >> >>What do you mean by "constraints are included"? Those were already >>included in my formulation. Since you only care about whether instances >>are valid or not, automation can in this case be regarded as a special >>case of constraints. Default values are completely irrelevant for your >>question because they do not change the set of allowed valid instances.
>
> To provide an analytic and deterministic answer to the viability of any db
> change, you must consider constraints, null rules, and defaults.
>
> Consider this case. Add two columns to a table, COL_A and COL_B, with the
> constraint that COL_A < COL_B. One has a default value, the other does
> not, and they may not be null. What on Earth do you do to satisfy these
> requirements in the rows that already exist in the table?
> upgrade will succeed. I did not choose your term "algorithmically decide"
> because it is not a step-by-step code thing, the validity or invalidity of
> the state change should be captured in the state of the meta-data. For the
> same reason I did not choose your term "mathematically prove". Demonstrate
> by Analysis seems closer to the mark because we want to examine (or
> analyze) the meta-data.
- Jan Hidders