Re: BUG #2532: os.chdir call in plpython function doesn't work

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #2532: os.chdir call in plpython function doesn't work
Дата
Msg-id 27357.1153026586@sss.pgh.pa.us
обсуждение исходный текст
Ответ на BUG #2532: os.chdir call in plpython function doesn't work  ("Tiziano Tissino" <t.tissino@itaca.coopsoc.it>)
Список pgsql-bugs
"Tiziano Tissino" <t.tissino@itaca.coopsoc.it> writes:
> I have a function like the following one:
> CREATE OR REPLACE FUNCTION public.test() RETURNS int4 AS $BODY$
> from os import chdir
> chdir('/tmp')
> test=plpy.execute('SELECT int_field FROM table1;')[0]['int_field']
> return test
> $BODY$ LANGUAGE 'plpythonu' VOLATILE;

chdir is a great way to break your database.  Don't do it.

Other things to avoid in plpythonu functions include: rm -rf,
kill -9 the postmaster, etc ...

            regards, tom lane

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

Предыдущее
От: "Tiziano Tissino"
Дата:
Сообщение: BUG #2532: os.chdir call in plpython function doesn't work
Следующее
От: "Konstantin Pavlovsky"
Дата:
Сообщение: postgresql bug on macosx