Received: from maia.hub.org (maia-3.hub.org [200.46.204.243]) by mail.postgresql.org (Postfix) with ESMTP id 71F8E133655C for ; Tue, 8 Feb 2011 21:31:54 -0400 (AST) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.243]) (amavisd-maia, port 10024) with ESMTP id 11992-01-2 for ; Wed, 9 Feb 2011 01:31:46 +0000 (UTC) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from nm17-vm0.bullet.mail.ukl.yahoo.com (nm17-vm0.bullet.mail.ukl.yahoo.com [217.146.183.93]) by mail.postgresql.org (Postfix) with SMTP id 86B761337C35 for ; Tue, 8 Feb 2011 21:31:29 -0400 (AST) Received: from [217.146.183.184] by nm17.bullet.mail.ukl.yahoo.com with NNFMP; 09 Feb 2011 01:31:29 -0000 Received: from [217.146.183.162] by tm15.bullet.mail.ukl.yahoo.com with NNFMP; 09 Feb 2011 01:31:29 -0000 Received: from [127.0.0.1] by omp1003.mail.ukl.yahoo.com with NNFMP; 09 Feb 2011 01:31:29 -0000 X-Yahoo-Newman-Property: ymail-3 X-Yahoo-Newman-Id: 554984.45231.bm@omp1003.mail.ukl.yahoo.com Received: (qmail 15295 invoked by uid 60001); 9 Feb 2011 01:31:29 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.it; s=s1024; t=1297215089; bh=eJ67c66Ukp3zKkoZxKqp3w4R3vBNc7rIDmxqCbQYHK0=; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=Ll/KI4rlQUkumAa8HOJrdeS53ERGjanuQAdiHX/0E+E0MVXFKlKiaBv1E8hyiMjU4TFt2GCeejIMsolWoPxrsRXaK99IwEkj+Pr6aB5vFsiXGr0wm1ZFyWqihPUHHK6UZtqm8lQ6NriGq1viu5IoDDf84hfTZg5HSQut4NS4ijA= DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.it; h=Message-ID:X-YMail-OSG:Received:X-Mailer:Date:From:Subject:To:MIME-Version:Content-Type; b=g7xIi4HA0vSgVLIw56XndVvbm6ga4bpFUTCfgCaCSq+Q02+2WSRTb4a/GRZKVnusM/zjFBFqIc2DtqOj80I4Mm/QSDzBe2LVnFZwWJMy7Huj3uNc91gLvST1czXYykybIaSZt7Ssdx7IKikQEBeAaS9WwEeCBX2CHsuXNBrmG98=; Message-ID: <447805.9668.qm@web25602.mail.ukl.yahoo.com> X-YMail-OSG: y9dtFqsVM1kN4NrJmxk1urFcAGbX8hmUP9unBr0GCzzczzE q7xNgjqyaiVUlP.9Kxq99DiKwb8xMGdXYIehk6wYkoy368Fsa7Ww3NJmND64 oinBDajVzHXK.efZ6re5QL27YUlbVV5amhFzQXEI4HStCq7inIKT_nrrOFbo Z5gXySY75.eQ.dSUam42gmmIJStnu6kvEt35womVvHogwwKQbvaxs2T8siob DqZPitJJk7pyxJfVhYVAPSS6vh4l6qeSXBwZRoYRTrXRi2kGvYewZfJXUqQk mnpD4hXT0 Received: from [2.38.133.131] by web25602.mail.ukl.yahoo.com via HTTP; Wed, 09 Feb 2011 01:31:29 GMT X-Mailer: YahooMailRC/555 YahooMailWebService/0.8.108.291010 Date: Wed, 9 Feb 2011 01:31:29 +0000 (GMT) From: Ludovico Bonifacio Subject: trigger on delete cascade To: pgsql-it-generale@postgresql.org MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="0-596060955-1297215089=:9668" X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=1.794 tagged_above=-10 required=5 tests=BAYES_50=0.8, FREEMAIL_FROM=0.001, HTML_FONT_FACE_BAD=0.981, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, RFC_ABUSE_POST=0.001, T_TO_NO_BRKTS_FREEMAIL=0.01 X-Spam-Level: * X-Archive-Number: 201102/1 X-Sequence-Number: 212 --0-596060955-1297215089=:9668 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable Ciao a tutti! =0A Esiste un modo per attivare un trigger(il cui scopo =E8 d= i salvare ci=F2 che si =0Aelimina) =0Anon su un evento sulla tabella per c= ui =E8 stato creato ma per effetto di una =0Acancellazione di un valore rif= erito in un altra tabella??=0AAd esempio ho:=0Ail trigger che si attiva=0AA= FTER DELETE ON Documento=0A=0Ae in Utente ho=0A id_utente ON DELETE CASCAD= E=0A=0Aquindi appena cancello un utente da Utente, giustamente il trigger n= on riconosce =0Ala DELETE perch=E8 la rileva su Documento. =0AEsiste un mod= o per fargli rilevare al Trigger di attivarsi anche nel caso di =0Aelimina= zioni on cascade da altre tabelle(in modo da salvare nella tabella =0Aarchi= vio ci=F2 che viene eliminato da Documento)?=0ASe si quale?=0ASe no, come p= otrei fare?=0A=0ANello specifico le tabelle sono cos=EC:=0ACREATE TABLE Doc= umento=0A(=0Aid_documento INTEGER PRIMARY KEY,=0Aid_utente INTEGER REFERENC= ES Utente(id_utente)=0AON UPDATE CASCADE=0AON DELETE CASCADE);=0A=0ACREATE = TABLEUtente=0A(=0Aid_utente INTEGER PRIMARY KEY;=0A);=0A=0AGrazie in antici= po a tutti=0A=0A=0A --0-596060955-1297215089=:9668 Content-Type: text/html; charset=iso-8859-1 Content-Transfer-Encoding: quoted-printable
Cia= o a tutti! 
 Esiste un modo per attivare un trigger(il = cui scopo =E8 di salvare ci=F2 che si elimina) 
non=0A su un evento sulla = ;tabella per cui =E8 sta= to creato ma per effetto di una cancellazione di un valore riferito in un altra ta= bella??
il trigger che si attiva
AFTER DELETE ON Documento

<= /font>
e in Utente ho
 id_utente ON DELETE=0A CASCADE

quindi ap= pena cancello un utente da Utente, giustamente il trigger non riconosce la = DELETE perch=E8 la rileva su Documento. 
Es= iste un modo per fargli rilevare al Trigger di attivarsi anche nel caso=0A = di eliminazioni on cascade da altre tabelle(in modo da salvare nella tabell= a archivio ci=F2 che viene eliminato da Documento)?
Se si quale?
Se no, come potrei fare?

Nello specifico le tabelle sono co= s=EC:
CREATE TABLE Documento
(
id_= documento INTEGER PRIMARY KEY,
id_utente INTEGER REFERENCES Utente(id_utente)
=09ON UPDATE CASCADE=
=09ON DEL= ETE CASCADE
);

CREATE TABLE Utente
(
id_utente INTEGER PRIMARY KEY;
);

Grazie in anticipo a tutti


=
=0A=0A=0A

=0A=0A=0A=0A
=
=0A=0A=0A

=0A=0A=0A=0A --0-596060955-1297215089=:9668--