By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,541 Members | 1,455 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,541 IT Pros & Developers. It's quick & easy.

passing new.* in trigger

P: n/a
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.********@w4b.it
tel: 055-2654270
---------------------------(end of broadcast)---------------------------
TIP 7: don't forget to increase your free space map settings

Nov 23 '05 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Alessandro Vincelli <a.********@w4b.it> writes:
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.*?


That will work in 8.0, but not before.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to ma*******@postgresql.org)

Nov 23 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.