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

From Richard Huxton
Subject Re: RULE - special variables?
Date
Msg-id 4552F3CD.10403@archonet.com
Whole thread Raw
In response to RULE - special variables?  (Matthew Peter <survivedsushi@yahoo.com>)
Responses Re: RULE - special variables?
List pgsql-general
Matthew Peter wrote:
> Do rules get special variables like triggers? Can I set variables in them like
> triggers?

You get NEW/OLD but they mean something subtly different. Rules act on a
query-tree so they are more like placeholders.

You can't set variables in triggers. You do so in a function. If your
rule calls a function, that could have variables.

Spend some time playing with rules - make sure you understand the
difference between them and triggers.
--
   Richard Huxton
   Archonet Ltd

pgsql-general by date:

Previous
From: Richard Huxton
Date:
Subject: Re: planer picks a bad plan (seq-scan instead of index)
Next
From: Richard Huxton
Date:
Subject: Re: TRIGGERS - access sql query_string that called it?