Re: RULES - Difference between DO and DO INSTEAD - Mailing list pgsql-sql

From Josh Berkus
Subject Re: RULES - Difference between DO and DO INSTEAD
Date
Msg-id web-685461@davinci.ethosmedia.com
Whole thread Raw
In response to RULES - Difference between DO and DO INSTEAD  (Luis Sousa <llsousa@ualg.pt>)
List 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 SQLCommands, some in Programmer's Guide.  Put in some effort into findingall the articles,
it'sworth it.
 

-Josh Berkus

______AGLIO DATABASE SOLUTIONS___________________________                                      Josh Berkus Complete
informationtechnology      josh@agliodbs.com  and data management solutions       (415) 565-7293 for law firms, small
businesses       fax 621-2533   and non-profit organizations.      San Francisco
 


pgsql-sql by date:

Previous
From: Tom Lane
Date:
Subject: Re: WAL filling up disk
Next
From: "Rudi"
Date:
Subject: Re: Database ownership