I would like to add the onDelete and onUpdate attributes to
the foreign key in the dtd.

<!ELEMENT foreign-key (reference+)>
<!ATTLIST foreign-key
  foreignTable CDATA #REQUIRED
  onUpdate (cascade|set null|restrict|none) "none"
  onDelete (cascade|set null|restrict|none) "none"
>


Also, at least for postgres, I would like to generate the foreign key
stuff in line (instead of generating it after the table).  It's much
more elegant (and easier) to generate :

  colname type REFERENCES table(id) ON DELETE cascade,

  than

CREATE TRIGGER if_dist_exists
    BEFORE INSERT OR UPDATE ON films FOR EACH ROW
    EXECUTE PROCEDURE check_primary_key ('col', 'table', 'col');
   
CREATE TRIGGER if_film_exists 
    BEFORE DELETE OR UPDATE ON distributors FOR EACH ROW
    EXECUTE PROCEDURE check_foreign_key (1, 'CASCADE', 'col', 'table', 'col');
   

mike

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to