Subject Re: [firebird-support] doing cascade update manually?
Author Helen Borrie
At 12:19 AM 14/12/2003 +0700, you wrote:

>Would declaring all foreign keys as CASCADE UPDATE be a "good practice"?

In general, yes.

>Some of my foreign keys are referencing unique columns, not PK, and
>these columns sometime change values (though infrequently). All of my PK
>usually don't change their value, but many times it's more convenient to
>refer to a UC instead of a PK.

Then you are falling into the trap creating of non-atomic dependencies.

>Sometimes I want to check whether the change in unique column value is
>"sensible", and if it is, I want to allow that (plus cascading).

In triggers you can test any incoming value and cause the entire operation
to abort by throwing an exception -- or simply catch the change and revert
it to OLD.value if it makes sense to do that. But, IMO, creating
dependencies between columns that humans can stuff up is a fool's game.