Subject | Re: [firebird-support] Re: Alternative for UNIQUE constraint |
---|---|
Author | Helen Borrie |
Post date | 2009-03-28T12:58:36Z |
At 10:59 PM 28/03/2009, you wrote:
"Explicit" means you need to have the FOREIGN KEY token (in the right place, of course) - as opposed to "implicit" as in the transcript you supplied, i.e. just supplying a REFERENCES clause to a column definition.
But adding a FOREIGN KEY constraint involves dependencies, hence the advice to deal with FK constraints *after* the prime definitions have all been committed. Failing to do so doesn't cause it to bomb every time; but because it can cause it sometimes, good practice says "Pre-empt Murphy".
Or...live dangerously... :-D
./hb
>Though the REFERENCE ... linesI don't know what you tested it on.
>themselves never caused a problem when I tested my example...
>Anyway, I moved them out of the CREATE TABLE statements and put themNo and/or yes. ;-)
>into separate ALTER TABLE ... ADD FOREIGN KEY ... statements. That's
>what you meant by explicitly and not in the same transaction, right?
"Explicit" means you need to have the FOREIGN KEY token (in the right place, of course) - as opposed to "implicit" as in the transcript you supplied, i.e. just supplying a REFERENCES clause to a column definition.
But adding a FOREIGN KEY constraint involves dependencies, hence the advice to deal with FK constraints *after* the prime definitions have all been committed. Failing to do so doesn't cause it to bomb every time; but because it can cause it sometimes, good practice says "Pre-empt Murphy".
Or...live dangerously... :-D
./hb