Re: RULE - special variables? - Mailing list pgsql-general

From Albe Laurenz
Subject Re: RULE - special variables?
Date
Msg-id 52EF20B2E3209443BC37736D00C3C1380B562CA8@EXADV1.host.magwien.gv.at
Whole thread Raw
In response to RULE - special variables?  (Matthew Peter <survivedsushi@yahoo.com>)
Responses Re: RULE - special variables?  (Shane Ambler <pgsql@007Marketing.com>)
List pgsql-general
> Do rules get special variables like triggers? Can I set
> variables in them like
> triggers?

A rule is one or more SQL-Statements - how do you set variables in SQL?

Don't think of a rule as a program!

In a statement in a rule, you have the pseudotables 'OLD' and 'NEW'
which refer to the affected rows of the table on which the rule is
defined, OLD (in DELETE and UPDATE rules) referring to the values before
the triggering statement takes place, and NEW (in INSERT and UPDATE)
referring to the values afterwards.

Yours,
Laurenz Albe

pgsql-general by date:

Previous
From: Richard Ollier
Date:
Subject: Table design - unknown number of column
Next
From: Alban Hertroys
Date:
Subject: Re: Table design - unknown number of column