pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Luis Sousa <llsousa@ualg.pt>
To: pgsql-sql@postgresql.org
Subject: Re: RULES - Difference between DO and DO INSTEAD
Date: Tue, 05 Feb 2002 10:20:37 -0800
Message-ID: <web-685461@davinci.ethosmedia.com> (raw)
In-Reply-To: <3C5FC183.6010605@ualg.pt>

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



view thread (2+ messages)

Message-ID: <web-685461@davinci.ethosmedia.com>
Permalink:  ../web-685461@davinci.ethosmedia.com/
Also on:    postgresql.org/message-id/web-685461@davinci.ethosmedia.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, llsousa@ualg.pt
  Subject: Re: RULES - Difference between DO and DO INSTEAD
  In-Reply-To: <web-685461@davinci.ethosmedia.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox