Re: RULE - special variables?

From: Richard Huxton <dev(at)archonet(dot)com>
To: Matthew Peter <survivedsushi(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: RULE - special variables?
Date: 2006-11-09 09:24:29
Message-ID: 4552F3CD.10403@archonet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Richard Huxton 2006-11-09 09:25:33 Re: TRIGGERS - access sql query_string that called it?
Previous Message Richard Huxton 2006-11-09 09:22:15 Re: planer picks a bad plan (seq-scan instead of index)