Re: Is this correct behavior for ON DELETE rule?

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

Rick Schumeyer wrote:
> I tried that, but I get a "...violates foreign-key constraint" error.

Oh, sorry.

---------------------------------------------------------------------------

>
> > -----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;
> > > );
> >
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 7: don't forget to increase your free space map settings
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Browse pgsql-general by date

  From Date Subject
Next Message elein 2005-02-26 02:06:25 Re: Newbie: help with FUNCTION
Previous Message Ron Mayer 2005-02-26 01:26:00 multicolumn GIST index question