plpythonu

Поиск
Список
Период
Сортировка
От Alexandre da Silva
Тема plpythonu
Дата
Msg-id 1200602631.6647.14.camel@alexandrelaptop
обсуждение исходный текст
Ответы Re: plpythonu  (Stuart Bishop <stuart@stuartbishop.net>)
Список pgsql-general
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)


В списке pgsql-general по дате отправления:

Предыдущее
От: "Scott Marlowe"
Дата:
Сообщение: Re: advocacy: drupal and PostgreSQL
Следующее
От: "Alex Turner"
Дата:
Сообщение: Re: advocacy: drupal and PostgreSQL