Re: "Could not open relation XXX: No such file or directory" - Mailing list pgsql-general

From Alvaro Herrera
Subject Re: "Could not open relation XXX: No such file or directory"
Date
Msg-id 20090824022132.GI5287@alvh.no-ip.org
Whole thread Raw
In response to Re: "Could not open relation XXX: No such file or directory"  (Alan Millington <admillington@yahoo.co.uk>)
List pgsql-general
Alan Millington wrote:

> However, on looking at the matter again, I am now almost certain that
> I caused the problem myself. I have a Python function which (as a
> workaround to a problem which exists in Python 2.4, the version to
> which Postgres 8.1.4 is tied) executes a chdir. It appears that once
> this has happened, the current Postgres session is no longer able to
> find any new data files, though evidently it is still able to use
> those that it has located previously. If you can confirm that Postgres
> does indeed rely on the current working directory to locate its data
> files, the problem is solved.   

Yes, Postgres expects that the CWD is not changed.  Files that were
previously opened continue to work fine, because they are kept open.
Do not chdir() in a function.

--
Alvaro Herrera                                http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: What approach should I use instead of creating tables on the fly?
Next
From: Alvaro Herrera
Date:
Subject: Re: Getting listed on "Community Guide to PostgreSQL GUI Tools"