From: Jim Buttafuoco <jim@contactbda.com>
To: Milen A. Radev <milen@radev.net>
To: pgsql-sql@postgresql.org
Subject: Re: new rule syntax?
Date: Sun, 5 Feb 2006 11:20:02 -0500
Message-ID: <20060205161818.M41848@contactbda.com> (raw)
In-Reply-To: <43E5F93F.8000503@radev.net>
References: <43E5E8D2.6020502@lake-lotawana.mo.us>
<43E5F93F.8000503@radev.net>
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@radev.net>
To: pgsql-sql@postgresql.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-V...).
>
> --
> Milen A. Radev
>
> ---------------------------(end of broadcast)---------------------------
> TIP 1: if posting/reading through Usenet, please send an appropriate
> subscribe-nomail command to majordomo@postgresql.org so that your
> message can get through to the mailing list cleanly
------- End of Original Message -------
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: jim@contactbda.com, milen@radev.net
Subject: Re: new rule syntax?
In-Reply-To: <20060205161818.M41848@contactbda.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox