Re: new rule syntax? - Mailing list pgsql-sql

From Richard Huxton
Subject Re: new rule syntax?
Date
Msg-id 43E71B9F.5090207@archonet.com
Whole thread Raw
In response to new rule syntax?  ("A. R. Van Hook" <hook@lake-lotawana.mo.us>)
List pgsql-sql
A. R. Van Hook wrote:
> I have two tables defined as:
> checks
>        (ckid                int NOT null PRIMARY KEY,
>         payto               text,
>         notes               text,
>         ckdate              date,
>         printed             int  default 0,
>         tdate               timestamp not null)
> checkitems
>        (item                int not null,
>         ckid                int NOT null references checks,
>         itemtype            int not null,
>         amt                 numeric(7,3),
>         primary key         (item, ckid))
> 
> in previous versions (<8.1) the following rule declaration seemed to 
> work fine

Others have addresses your query with the rule. Can I ask why you're not 
using a DELETE CASCADE on the fkey?
...
ckid    int NOT null references checks ON DELETE CASCADE,
...

--   Richard Huxton  Archonet Ltd


pgsql-sql by date:

Previous
From: Tony Wasson
Date:
Subject: Re: Function Dependency
Next
From: Josep Sanmartí
Date:
Subject: Trigger on a column