Re: Is this correct behavior for ON DELETE rule?

From: "Rick Schumeyer" <rschumeyer(at)ieee(dot)org>
To: "'Bruce Momjian'" <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: "'PgSql General'" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Is this correct behavior for ON DELETE rule?
Date: 2005-02-26 01:11:08
Message-ID: 000d01c51ba0$0d875f20$0200a8c0@dell8200
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I tried that, but I get a "...violates foreign-key constraint" error.

> -----Original Message-----
> From: pgsql-general-owner(at)postgresql(dot)org [mailto:pgsql-general-
> owner(at)postgresql(dot)org] On Behalf Of Bruce Momjian
> Sent: Friday, February 25, 2005 6:23 PM
> To: Rick Schumeyer
> Cc: 'PgSql General'
> Subject: Re: [GENERAL] Is this correct behavior for ON DELETE rule?
>
>
> Uh, because of your REFERENCES clause you have to delete from 'item'
> first, then 'book':
>
> > -- delete to item and book instead of bookview
> > create rule bookviewdel as on delete to bookview do instead (
> > delete from item where id=old.id;
> > delete from book where id=old.id;
> > );
>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Mayer 2005-02-26 01:26:00 multicolumn GIST index question
Previous Message Rick Schumeyer 2005-02-26 01:02:09 Re: Is this correct behavior for ON DELETE rule?