Re: BUG #1740: Deferred foreign key constraint isn't deferred - Mailing list pgsql-bugs

From Stephan Szabo
Subject Re: BUG #1740: Deferred foreign key constraint isn't deferred
Date
Msg-id 20050630102136.G34918@megazone.bigpanda.com
Whole thread Raw
In response to BUG #1740: Deferred foreign key constraint isn't deferred  ("Daniel Cristian Cruz" <dccruz@mega.com.br>)
List pgsql-bugs
On Thu, 30 Jun 2005, 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;
>
> BEGIN;
> DELETE FROM mat_nf_saida_itens WHERE mat_nsi_in_ordem = 2;
> UPDATE mat_comissao_itens SET mat_nsi_in_ordem = 1 WHERE mat_nsi_in_ordem =
> 2;
> COMMIT;

Referential actions are immediate (they're defined as actions that happen
upon the occurrance), it's the constraint checks that are deferrable with
the deferrable/initially deferred.

pgsql-bugs by date:

Previous
From: "Bobi Ivanov"
Date:
Subject: Re: BUG #1735: row number -1 is out of range 0..-1 error
Next
From: Daniel Cristian Cruz
Date:
Subject: Re: BUG #1740: Deferred foreign key constraint isn't deferred