X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.193]) by svr1.postgresql.org (Postfix) with ESMTP id 9F6C930E7F0 for ; Fri, 13 Jun 2003 01:27:36 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (svr1.postgresql.org [64.117.224.193]) (amavisd-new, port 10024) with ESMTP id 13480-04 for ; Thu, 12 Jun 2003 22:27:26 -0300 (ADT) Received: from annwfn.erfurt.igrz.de (annwfn.erfurt.igrz.de [195.190.142.1]) by svr1.postgresql.org (Postfix) with ESMTP id AD14030D175 for ; Thu, 12 Jun 2003 22:27:25 -0300 (ADT) Received: from nibiru.UUCP (uucp@localhost) by annwfn.erfurt.igrz.de (8.12.9/8.12.9) with bsmtp id h5D1RPoo008544 for pgsql-sql@postgresql.org; Fri, 13 Jun 2003 03:27:25 +0200 Received: (from weigelt@localhost) by metux.de (8.12.6/8.12.7) id h5D1QBZt025923 for pgsql-sql@postgresql.org; Fri, 13 Jun 2003 03:26:11 +0200 Date: Fri, 13 Jun 2003 03:26:11 +0200 From: weigelt@metux.de To: PGSQL-SQL Subject: question on rules Message-ID: <20030613012611.GA25276@metux.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.3.27i X-Message-Flag: Wenn dieser Text erscheint besteht enorme Virengefahr. Bitte verwenden Sie niemals Outlook oder Outlook Express. X-Archive-Number: 200306/118 X-Sequence-Number: 13876 hi folks, i'd like to write an rule which fills out some empty attrs on insert (w/ data from other given attrs). the table structure is: CREATE TABLE foo (start date, duration integer, endtime date); and the rule is: CREATE RULE foo1 AS ON INSERT TO foo WHERE new.endtime = NULL DO INSERT INTO foo SELECT new.start, new.duration, new.start + new.duration; when i try to insert some data (INSERT INTO foo SELECT '2003-01-01', '12';) i get the error: query rewritten 10 times, may contain cycles. how can i avoid this loop ? cu -- --------------------------------------------------------------------- Enrico Weigelt == metux ITS Webhosting ab 5 EUR/Monat. UUCP, rawIP und vieles mehr. phone: +49 36207 519931 www: http://www.metux.de/ fax: +49 36207 519932 email: contact@metux.de cellphone: +49 174 7066481 smsgate: sms.weigelt@metux.de --------------------------------------------------------------------- Diese Mail wurde mit UUCP versandt. http://www.metux.de/uucp/