passing new.* in trigger

From: Alessandro Vincelli <a(dot)vincelli(at)w4b(dot)it>
To: pgsql-general(at)postgresql(dot)org
Subject: passing new.* in trigger
Date: 2004-10-06 15:45:09
Message-ID: 41641305.9080004@w4b.it
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I must pass NEW row to function count_room(rowtype) as in this code, but
pgsql return "_ NEW used in query that is not in a rule".
I have a bad syntax or is impossible pass NEW.*?

thanks, Ale

_
CREATE OR REPLACE FUNCTION public.dr_aggiorna_consistenze()
RETURNS trigger AS
'
declare
room int;
BEGIN

SELECT INTO camere count_room(NEW.*) FROM NEW ;
NEW.camere = camere;
RETURN NEW;
END;
'
LANGUAGE 'plpgsql' VOLATILE;

--
-------------------------------
Alessandro Vincelli
W4B - web for business s.r.l.
Firenze
via Pellicceria 10 - 50123
E-mail: a(dot)vincelli(at)w4b(dot)it
tel: 055-2654270

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Dennis Gearon 2004-10-06 15:58:14 Re: database constraints
Previous Message Mark Gibson 2004-10-06 15:44:07 Re: Cache lookup failed for relation, when trying to DROP