Re: RULES - Difference between DO and DO INSTEAD

From: "Josh Berkus" <josh(at)agliodbs(dot)com>
To: Luis Sousa <llsousa(at)ualg(dot)pt>, pgsql-sql(at)postgresql(dot)org
Subject: Re: RULES - Difference between DO and DO INSTEAD
Date: 2002-02-05 18:20:37
Message-ID: web-685461@davinci.ethosmedia.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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(at)agliodbs(dot)com
and data management solutions (415) 565-7293
for law firms, small businesses fax 621-2533
and non-profit organizations. San Francisco

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2002-02-05 20:53:19 Re: WAL filling up disk
Previous Message Tom Lane 2002-02-05 18:18:21 Re: WAL filling up disk