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

From: "Heikki Linnakangas" <heikki(at)enterprisedb(dot)com>
To: "Timur Luchkin" <timur(dot)luchkin(at)ctxm(dot)com>
Cc: <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory
Date: 2007-10-12 13:34:59
Message-ID: 470F7803.9040207@enterprisedb.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2007-10-12 14:23:17 Re: expression_tree_walker() and primitive node types
Previous Message Timur Luchkin 2007-10-12 13:01:07 BUG #3673: Untrusted perl language: ERROR: could not open relation 1663/16384/1259: No such file or directory