Re: triggers vs "NEW" pseudorecord

From: Jan Wieck <janwieck(at)Yahoo(dot)com>
To: will trillich <will(at)serensoft(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: triggers vs "NEW" pseudorecord
Date: 2001-03-04 12:07:24
Message-ID: 200103041207.HAA02349@jupiter.jw.home
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

will trillich wrote:
> okay. postgres 7.0.3 here, on debian potato/stable.

OK - so far.

> [...]
>
> so altho the docs elsewhere say NOT to rely on access to the
> pseudo table NEW within a trigger function, this part does work
> like it should. but when i add SELECT or UPDATE it complains of
> "NEW used in non-RULE query" -- what's the distinction?

Can't reproduce such an error here - neither with 7.0.3 nor
with 7.1. Could you please post a complete, reproduceable
example of the failure. Tables, functions, trigger
declarations, queries.

>
> what types of operations are NOT LEGAL within such a
> trigger-invoked function? (i'd like to be able to UPDATE other
> tables and SELECT from various tables within the function. bad
> dog?)

That's definitely possible and the PL/pgSQL regression test
suite does it.

Jan

--

#======================================================================#
# It's easier to get forgiveness for being wrong than for being right. #
# Let's break this rule - forgive me. #
#================================================== JanWieck(at)Yahoo(dot)com #

_________________________________________________________
Do You Yahoo!?
Get your free @yahoo.com address at http://mail.yahoo.com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Louis-David Mitterrand 2001-03-04 12:18:38 Re: avoiding endless loop in an UPDATE trigger
Previous Message Jan Wieck 2001-03-04 09:52:16 Re: can a trigger on insert -> update other tables?