Hello,
someone can tell me if is secure to create external python modules and
import them to functions/procedures/triggers to use?
I am doing the following:
function/procedure/trigger:
CREATE OR REPLACE FUNCTION tabela_be_i_tg_fx() RETURNS trigger AS $body$
from dbfunctions.postgres.pg_trigger import TestTrigger as fx
fe = fx()
return fe.execute(args=TD["args"], event=TD["event"], when=TD["when"],
level=TD["level"], name=TD["name"], relid=TD["relid"], new=TD["new"],
old=TD["old"], pl_py=plpy)
$body$
LANGUAGE plpythonu;
at python module I have:
class TestTrigger(object):
def execute(self, args, event, when, level, name, relid, new, old,
pl_py):
new["group_name"]='__modified__'
return 'MODIFY'
all this works properly (on windows and linux), but I don't know if is
the correct way to use plpythonu, and if I will have future problems.
Another question is that I have read in some discussion list (old
message year 2003) the possibility of plpython be removed from
postgresql, this information is valid yet?
sorry bad English
Thank's for all
--
Alexandre da Silva
Analista de Sistemas - Bacharel em Sistemas de Informação (2003-2007)