On Friday 19 September 2003 14:02, Jean-Christian Imbeault wrote:
> Oliver Elphick wrote:
> >>Foreign Key constraints: $1 FOREIGN KEY (pid) REFERENCES products(id) ON
> >>UPDATE NO ACTION ON DELETE NO ACTION
> >
> > Drop the constraint; then add an amended one.
>
> Ok, how do I drop the constraint, it has no name.
Its name is "$1" - use
DROP CONSTRAINT "$1" ...
> Secondly what is the correct syntax for adding a new constraint with ON
> DELETE CASCADE?
See the SQL command reference for ALTER TABLE. It's something like:
ALTER TABLE mytable ADD CONSTRAINT constraint_name FOREIGN KEY ... etc
--
Richard Huxton
Archonet Ltd