Skip site navigation (1) Skip section navigation (2)

Re: BUG #1740: Deferred foreign key constraint isn't deferred

From: Michael Fuhr <mike(at)fuhr(dot)org>
To: Daniel Cristian Cruz <dccruz(at)mega(dot)com(dot)br>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #1740: Deferred foreign key constraint isn't deferred
Date: 2005-06-30 13:44:34
Message-ID: 20050630134434.GA40114@winnie.fuhr.org (view raw or flat)
Thread:
Lists: pgsql-bugs
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/

In response to

Responses

pgsql-bugs by date

Next:From: Jean-Max ReymondDate: 2005-06-30 13:48:05
Subject: Re: BUG #1739: memory leak in pl/perl with spi_exec_query
Previous:From: Daniel Cristian CruzDate: 2005-06-30 13:01:39
Subject: BUG #1740: Deferred foreign key constraint isn't deferred

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group