Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.4) with ESMTP id g15IKel54800 for ; Tue, 5 Feb 2002 13:20:40 -0500 (EST) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.5.2) with HTTP id 685461; Tue, 05 Feb 2002 10:20:37 -0800 From: "Josh Berkus" Subject: Re: RULES - Difference between DO and DO INSTEAD To: Luis Sousa , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.5.2 Date: Tue, 05 Feb 2002 10:20:37 -0800 Message-ID: In-Reply-To: <3C5FC183.6010605@ualg.pt> MIME-Version: 1.0 Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit X-Archive-Number: 200202/62 X-Sequence-Number: 6492 Luis, > I'm building some rules for some views that I have, but I did'nt > understand yet what's the difference between doing a rule with DO or > with DO INSTEAD. > What's the diference ? Simple: CREATE RULE xxx ON UPDATE TO yyy WHERE www=zzz ... DO ACTION: do the action, then go ahead and update the table. DO INSTEAD ACTION: do the action, and *do not* update the table. IMHO, the online docs on Rules and Triggers are quite good. However, they are scattered around the online documentation; some is in SQL Commands, some in Programmer's Guide. Put in some effort into finding all the articles, it's worth it. -Josh Berkus ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco