pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Martin <hier-bei-mir@gmx.net>
To: pgsql-bugs@postgresql.org
Subject: Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete
Date: Wed, 26 Apr 2017 09:18:56 -0700 (MST)
Message-ID: <1493223536261-5958509.post@n3.nabble.com> (raw)
In-Reply-To: <24945.1477510973@sss.pgh.pa.us>
References: <CAJ3Xv+jzJ8iNNUcp4RKW8b6Qp1xVAxHwSXVpjBNygjKxcVuE9w@mail.gmail.com>
	<24945.1477510973@sss.pgh.pa.us>
List-Unsubscribe: <mailto:majordomo@postgresql.org?body=unsub%20pgsql-bugs>

Hi,

I am facing the exact same bug when using circular references:

create table m (f1 int primary key, f2 int);
create table s (f2 int primary key, f1 int);
-- Method A --> no error
--alter table s add constraint fkey1 foreign key (f1) references m (f1) on
delete cascade initially deferred;
--alter table m add constraint fkey2 foreign key (f2) references s (f2) on
delete cascade initially deferred;
-- Method B --> error when workaround not used
alter table s add constraint fkey1 foreign key (f1) references m (f1) on
delete cascade on update no action;
alter table s alter constraint fkey1 deferrable initially deferred;
alter table m add constraint fkey2 foreign key (f2) references s (f2) on
delete cascade on update no action;
alter table m alter constraint fkey2 deferrable initially deferred;
-- workaround to fix tgdeferrable and tginitdeferred on delete constraints,
just uncomment next line
-- update pg_trigger set tgdeferrable = false, tginitdeferred = false where
tgtype = 9;
begin transaction;
insert into m values (1,1);
insert into s values (1,1);
commit;
delete from m where f1=1;
drop table s cascade;

The same AfterTriggerSaveEvent() error occurs at the delete command. I found
a workaround to fix the wrong booleans after reading:
https://www.postgresql.org/message-id/8559.1289949074%40sss.pgh.pa.us

Is there any update on this?

best
Martin



--
View this message in context: http://www.postgresql-archive.org/AfterTriggerSaveEvent-Error-on-altered-foreign-key-cascaded-delete...
Sent from the PostgreSQL - bugs mailing list archive at Nabble.com.


-- 
Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-bugs



view thread (5+ messages)  latest in thread

Message-ID: <1493223536261-5958509.post@n3.nabble.com>
Permalink:  ../1493223536261-5958509.post@n3.nabble.com/
Also on:    postgresql.org/message-id/1493223536261-5958509.post@n3.nabble.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: hier-bei-mir@gmx.net
  Subject: Re: AfterTriggerSaveEvent() Error on altered foreign key cascaded delete
  In-Reply-To: <1493223536261-5958509.post@n3.nabble.com>
  References: <CAJ3Xv+jzJ8iNNUcp4RKW8b6Qp1xVAxHwSXVpjBNygjKxcVuE9w@mail.gmail.com> <24945.1477510973@sss.pgh.pa.us> <1493223536261-5958509.post@n3.nabble.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox