Re: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory - Mailing list pgsql-bugs

From Heikki Linnakangas
Subject Re: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory
Date
Msg-id 470F7803.9040207@enterprisedb.com
Whole thread Raw
In response to BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory  ("Timur Luchkin" <timur.luchkin@ctxm.com>)
List pgsql-bugs
Timur Luchkin wrote:
> I have stored procedure in "plperlu" language. After the call to it Im
> getting "could not open relation ... No such file or directory" on any next
> operation in psql (the procedure itself works fine). If I'll close the
> console and reopen it again, then everything works fine again (until the
> next call to it).
>
> Perl's SP code:
> ...
>       chdir("$base_path");
> ...

Don't do that. Postgres sets the current directory to the data
directory, and uses relative paths to access all the relation files.
Calling chdir will confuse the server.

You could use absolute paths in your plperlu function instead.

--
  Heikki Linnakangas
  EnterpriseDB   http://www.enterprisedb.com

pgsql-bugs by date:

Previous
From: "Timur Luchkin"
Date:
Subject: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory
Next
From: Tom Lane
Date:
Subject: Re: expression_tree_walker() and primitive node types