Re: "OLD used in query that is not in a rule"

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: "OLD used in query that is not in a rule"
Date: 2012-03-26 14:51:56
Message-ID: 25303.1332773516@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

"Gauthier, Dave" <dave(dot)gauthier(at)intel(dot)com> writes:
> I get... "OLD used in query that is not in a rule" when trying to ref, for example, OLD.tblcol1, from inside a stored procedure. Is this saying you cannot use OLD.* (or NEW.* I suppose) unless it's from within a trigger function (returns type "trigger")?

Certainly. You'd have to pass the field (or whole record) as a
parameter. It's not some kind of magic global variable, it's
a predefined local variable in a trigger function (or rule).

regards, tom lane

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Gauthier, Dave 2012-03-26 14:54:11 Re: "OLD used in query that is not in a rule"
Previous Message Gauthier, Dave 2012-03-26 14:42:33 "OLD used in query that is not in a rule"