Re: (trigger function) -> ERROR: NEW used in non-rule query - Mailing list pgsql-sql

From Richard Huxton
Subject Re: (trigger function) -> ERROR: NEW used in non-rule query
Date
Msg-id 200307181406.00852.richardh@archonet.com
Whole thread Raw
In response to Re: (trigger function) -> ERROR: NEW used in non-rule query  (Terence Kearns <terencek@isd.canberra.edu.au>)
List pgsql-sql
On Friday 18 July 2003 10:18, Terence Kearns wrote:
> damn. There's realy no other way for me to access the value since the
> trigger function will be called from different relations.
>
> I tried idval := (''NEW.'' || TG_ARGV[3]); but recieved
> ERROR: pf_atoi: error in "NEW.blah": can't parse "NEW.blah"
>
> Oh well, can't win them all :/

Well, not this one at the moment, anyway.

> Well I suppose I could try TCL. The problem is that there is little to
> no documentation on postgres stored procedures in TCL and I've never
> even seen the language before. None the less, I'll look into it. It's
> almost worth it. If that fails, I may even try perl <shudders>. if that
> files, I will try to get --with-python to configure (which it's refusing
> to do at the moment even though I have a working installation).

Not sure if you can write triggers in perl, and I think python is going 
untrusted only (which means you need to be an admin to create functions).

- Richard Huxton


pgsql-sql by date:

Previous
From: Terence Kearns
Date:
Subject: Re: (trigger function) -> ERROR: NEW used in non-rule query
Next
From: Chris Travers
Date:
Subject: How to determine the currently logged on username