On Thu, Jun 30, 2005 at 02:01:39PM +0100, Daniel Cristian Cruz wrote: > > ALTER TABLE ONLY mat_comissao_itens > ADD CONSTRAINT mat_nf_saida_itens_pa_mat_comissao_itens FOREIGN KEY > (mat_nfs_diretorio, mat_nfs_in_codigo, mat_nsi_in_ordem) REFERENCES > mat_nf_saida_itens(mat_nfs_diretorio, mat_nfs_in_codigo, mat_nsi_in_ordem) > ON UPDATE RESTRICT ON DELETE RESTRICT DEFERRABLE INITIALLY DEFERRED;
Note the following in the CREATE TABLE documentation: RESTRICT Produce an error indicating that the deletion or update would create a foreign key constraint violation. This is the same as NO ACTION except that the check is not deferrable. http://www.postgresql.org/docs/8.0/static/sql-createtable.html -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 7: don't forget to increase your free space map settings