Re: RULE - special variables?

From: "Albe Laurenz" <all(at)adv(dot)magwien(dot)gv(dot)at>
To: "Matthew Peter *EXTERN*" <survivedsushi(at)yahoo(dot)com>, <pgsql-general(at)postgresql(dot)org>
Subject: Re: RULE - special variables?
Date: 2006-11-09 09:51:42
Message-ID: 52EF20B2E3209443BC37736D00C3C1380B562CA8@EXADV1.host.magwien.gv.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2006-11-09 09:56:58 Re: Table design - unknown number of column
Previous Message Richard Huxton 2006-11-09 09:26:33 Re: dblink / plpgsql - definition list cheats for record