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

Re: Backend working directories and absolute file paths

From: Andrew Dunstan <andrew(at)dunslane(dot)net>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Backend working directories and absolute file paths
Date: 2005-06-30 18:20:22
Message-ID: 42C437E6.5000301@dunslane.net (view raw or flat)
Thread:
Lists: pgsql-hackers

Tom Lane wrote:

>What I am speculating about is:
>	1. At postmaster start (or standalone backend start),
>	   chdir into $PGDATA.
>	2. Henceforth, address everything under $PGDATA by
>	   relative paths; don't use DataDir in the path at all.
>
>This way, if someone moves a data directory with a running postmaster
>in it, nothing breaks at all.  It would probably run a bit faster too,
>since file open calls would have fewer directories to traverse through.
>  
>

Makes plenty of sense, and is a common way of working.

>The only downside I can see to it is that backend and postmaster crashes
>would all consistently dump core into $PGDATA (on platforms where cores
>dump into the working directory, which is many but not all).  The
>current arrangement makes backends dump core into the subdirectory for
>the database they are in, which sometimes makes it a bit easier to
>identify what's what.  But I can't see that that's a valuable enough
>property to override the advantages of using relative paths.
>
>
>  
>

Maybe I have misunderstood. Could the backends not chdir into the db 
subdir and then do everything relative to that (using .. if necessary)?

How does this all play with tablespaces?

cheers

andrew

In response to

Responses

pgsql-hackers by date

Next:From: Andrew DunstanDate: 2005-06-30 18:31:01
Subject: Re: Backend working directories and absolute file paths
Previous:From: Peter EisentrautDate: 2005-06-30 17:29:07
Subject: Re: Occupied port warning

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