On Samstag, 7. Juli 2007 Paul Stevens wrote:
> > That's why I looked into triggers, and found postgreSQL to have
> > rules: CREATE RULE drop_messages_with_mailbox AS ON DELETE TO
> > dbmail_messages DO DELETE FROM dbmail_physmessage WHERE id =
> > OLD.physmessage_id;
>
> Evil dude. That's a simple foreign key constraint masking as a rule.

Nobody should use that rule: I found that rule to have the effect of 
deleting all new arriving e-mail - it just vanishes, although I am not 
sure why. It arrives via LMTP, and is not in your mailbox. But that 
rule should only fire on DELETE, so there must be a delete somewhere in 
the path when a new message is inserted, or postgres has a bug, or 
whatever.

I've tried your trigger now, e-mails still arrive :-)

But I tried to delete some users:
delete from dbmail_users where user_idnr in (1098,1099,1100);

And didn't get any response, so I pressed CTRL-C and it said:
Cancel request sent
FEHLER:  storniere Anfrage wegen Benutzeraufforderung
KONTEXT:  SQL-Anweisung »delete from dbmail_physmessage where  $1  not in 
(select physmessage_id from dbmail_messages)«
PL/pgSQL function "physmessage_gc" line 2 at SQL statement
SQL-Anweisung »DELETE FROM ONLY "public"."dbmail_messages" WHERE 
"physmessage_id" = $1«
SQL-Anweisung »delete from dbmail_physmessage where  $1  not in (select 
physmessage_id from dbmail_messages)«
PL/pgSQL function "physmessage_gc" line 2 at SQL statement
SQL-Anweisung »DELETE FROM ONLY "public"."dbmail_messages" WHERE "mailbox_idnr" 
= $1«
SQL-Anweisung »DELETE FROM ONLY "public"."dbmail_mailboxes" WHERE "owner_idnr" 
= $1«

It's not clear to me where the problem is.

mfg zmi
-- 
// Michael Monnerie, Ing.BSc    -----      http://it-management.at
// Tel: 0676/846 914 666                      .network.your.ideas.
// PGP Key:         "curl -s http://zmi.at/zmi.asc | gpg --import"
// Fingerprint: EA39 8918 EDFF 0A68 ACFB  11B7 BA2D 060F 1C6F E6B0
// Keyserver: www.keyserver.net                   Key-ID: 1C6FE6B0

Attachment: signature.asc
Description: This is a digitally signed message part.

_______________________________________________
DBmail mailing list
DBmail@dbmail.org
https://mailman.fastxs.nl/mailman/listinfo/dbmail

Reply via email to