constraint deferred but fails? - Mailing list pgsql-admin

From Nagy László Zsolt
Subject constraint deferred but fails?
Date
Msg-id 7db1a61c-1f0e-d233-0756-b7eecf2f420d@shopzeus.com
Whole thread Raw
Responses Re: constraint deferred but fails?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Re: constraint deferred but fails?  (Ron <ronljohnsonjr@gmail.com>)
Re: constraint deferred but fails?  (Shreeyansh Dba <shreeyansh2014@gmail.com>)
List pgsql-admin
Hello,

I have deferred the only fk constraint to this table inside a
transaction, but I still cannot delete rows from it.

How is that possible?


master=> ALTER TABLE doc.display_mode disable trigger user;
ALTER TABLE
master=> BEGIN;
BEGIN
master=> SET CONSTRAINTS doc.fk_book_display_mode_id DEFERRED;
SET CONSTRAINTS
master=> DELETE FROM doc.display_mode;
ERROR:  update or delete on table "display_mode" violates foreign key
constraint "fk_book_display_mode_id" on table "book"
DETAIL:  Key (id)=(1) is still referenced from table "book".
master=>



pgsql-admin by date:

Previous
From: Shreeyansh Dba
Date:
Subject: Re: Creation of temporary tables on a publisher
Next
From: "David G. Johnston"
Date:
Subject: Re: constraint deferred but fails?