Received: from zukerman-1.dsl.speakeasy.net (zukerman-1.dsl.speakeasy.net [216.254.75.142]) by hub.org (8.10.1/8.10.1) with ESMTP id e6SB48B00273 for ; Fri, 28 Jul 2000 07:04:08 -0400 (EDT) Received: from (matt.w80.math-hat.com) [216.254.75.141] by zukerman-1.dsl.speakeasy.net with esmtp (Exim 3.12 #1 (Debian)) id 13I7vl-0000hk-00; Fri, 28 Jul 2000 07:03:53 -0400 Received: from zukerman by matt.w80.math-hat.com with local (Exim 3.12 #1 (Debian)) id 13I7vz-00017X-00 for ; Fri, 28 Jul 2000 07:04:07 -0400 To: Subject: Re: Conditional rule? References: <200007272216.AAA28690@hot.jw.home> <00f001bff876$cc57f8d0$74b5f8c2@wkst6> From: Itai Zukerman Date: 28 Jul 2000 07:04:07 -0400 In-Reply-To: "=?iso-8859-1?q?Andr=E9_N=E6ss?="'s message of "Fri, 28 Jul 2000 11:32:46 +0200" Message-ID: <87zon2tt20.fsf@matt.w80.math-hat.com> Lines: 17 User-Agent: Gnus/5.0807 (Gnus v5.8.7) Emacs/20.7 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200007/271 > > CREATE RULE newsrule AS ON INSERT TO news > > WHERE new.publishtime NOTNULL DO > > INSERT INTO news_unpublished VALUES (new.id); > > The following happens: > rules=# insert into news (title, time) values('Hei', now()); > ERROR: referential integrity violation - key referenced from > news_unpublished not found in news I noticed this, too. More generally, I've found that whereas rules initially looked like a great thing to use, in practice I have really no idea what they're going to do. And I find their description in the programmer's guide confusing. Is there any better rules tutorial out there? -itai