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

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

From: "Tiziano Tissino" <t(dot)tissino(at)itaca(dot)coopsoc(dot)it>
To: pgsql-bugs(at)postgresql(dot)org
Subject: BUG #2532: os.chdir call in plpython function doesn't work
Date: 2006-07-15 18:39:43
Message-ID: 200607151839.k6FIdhEf087933@wwwmaster.postgresql.org (view raw or flat)
Thread:
Lists: pgsql-bugs
The following bug has been logged online:

Bug reference:      2532
Logged by:          Tiziano Tissino
Email address:      t(dot)tissino(at)itaca(dot)coopsoc(dot)it
PostgreSQL version: 8.1.4
Operating system:   Linux (Ubuntu Dapper)
Description:        os.chdir call in plpython function doesn't work
Details: 

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;

when calling it, I get an error like this one:
db=# select test(); WARNING:  plpython: in function test:
DETAIL:  plpy.SPIError: Unknown error in PLy_spi_execute_query
ERROR:  could not open relation 1663/16737/18906: No such file or directory
CONTEXT:  SQL statement "SELECT int_field FROM table1;"

The same function, without the row "chdir('/tmp')", works fine.

I just upgraded to 8.1.4; with previous db version (8.0), that function
worked fine as well.

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2006-07-16 05:09:46
Subject: Re: BUG #2532: os.chdir call in plpython function doesn't work
Previous:From: Tom LaneDate: 2006-07-14 16:46:54
Subject: Re: BUG #2531: missing header dependency in src/port/Makefile

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