Re: "Could not open relation XXX: No such file or directory"

From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Alan Millington <admillington(at)yahoo(dot)co(dot)uk>
Cc: Postgres general mailing list <pgsql-general(at)postgresql(dot)org>
Subject: Re: "Could not open relation XXX: No such file or directory"
Date: 2009-08-24 02:21:32
Message-ID: 20090824022132.GI5287@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alvaro Herrera 2009-08-24 02:24:57 Re: Getting listed on "Community Guide to PostgreSQL GUI Tools"
Previous Message Craig Ringer 2009-08-24 02:00:42 Re: What approach should I use instead of creating tables on the fly?