Forums | Admin

Discussion Forums: help

Start New Thread Start New Thread

 

By: venkat venkat
about plruby [ reply ]  
2007-05-25 13:50
Hi All,
what does the following error mean when I run the code with postgresql 8.X as db server.

CREATE FUNCTION trigfunc_modcount() RETURNS TRIGGER AS '
case tg["op"]
when PL::INSERT
new[args[0]] = 0
when PL::UPDATE
new[args[0]] = old[args[0]].to_i + 1
else
return PL::OK
end
new
' LANGUAGE 'plruby';

CREATE TABLE mytab (num int4, modcnt int4, descr text);

CREATE TRIGGER trig_mytab_modcount BEFORE INSERT OR UPDATE ON mytab
FOR EACH ROW EXECUTE PROCEDURE trigfunc_modcount('modcnt');

the error is
"language "plruby" does not exist "

any help appreciated.

venkat,
rknowsys