Re: new rule syntax?

From: "Jim Buttafuoco" <jim(at)contactbda(dot)com>
To: "Milen A(dot) Radev" <milen(at)radev(dot)net>, pgsql-sql(at)postgresql(dot)org
Subject: Re: new rule syntax?
Date: 2006-02-05 16:20:02
Message-ID: 20060205161818.M41848@contactbda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql


Try this rule instead
create rule checks_d0 as
on delete to checks
do delete from checkitems
where ckid = OLD.ckid;

---------- Original Message -----------
From: "Milen A. Radev" <milen(at)radev(dot)net>
To: pgsql-sql(at)postgresql(dot)org
Sent: Sun, 05 Feb 2006 15:10:23 +0200
Subject: Re: [SQL] new rule syntax?

[UTF-8?]> A. R. Van Hook написа:
> > 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
> > create rule checks_d0 as
> > on delete to checks
> > do delete from checkitems
> > where ckid = checks.ckid;
> > in 8.1.2 I get
> >
> > ERROR: missing FROM-clause entry from table "checks"
> >
> > any idea?
>
> May be you are bitten by the change of the default value of
> "add_missing_from" setting
> (http://www.postgresql.org/docs/8.1/static/runtime-config-compatible.html#RUNTIME-CONFIG-COMPATIBLE-VERSION).
>
> --
> Milen A. Radev
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> message can get through to the mailing list cleanly
------- End of Original Message -------

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Tony Wasson 2006-02-06 02:18:33 Re: Function Dependency
Previous Message A. Kretschmer 2006-02-05 13:17:31 Re: new rule syntax?