Skip site navigation (1) Skip section navigation (2)

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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Tiziano Tissino" <t(dot)tissino(at)itaca(dot)coopsoc(dot)it>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #2532: os.chdir call in plpython function doesn't work
Date: 2006-07-16 05:09:46
Message-ID: 27357.1153026586@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Tiziano Tissino" <t(dot)tissino(at)itaca(dot)coopsoc(dot)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

In response to

pgsql-bugs by date

Next:From: Konstantin PavlovskyDate: 2006-07-16 11:03:32
Subject: postgresql bug on macosx
Previous:From: Tiziano TissinoDate: 2006-07-15 18:39:43
Subject: BUG #2532: os.chdir call in plpython function doesn't work

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group