pg_ctl restart issue with relative paths - Mailing list pgsql-bugs

From Thom Brown
Subject pg_ctl restart issue with relative paths
Date
Msg-id CAA-aLv72O+NegjAipHORmbqSMZTkZayaTxrd+C9v60YbmMmZUQ@mail.gmail.com
Whole thread Raw
Responses Re: pg_ctl restart issue with relative paths
List pgsql-bugs
Hi,

I have noticed that, using pg_ctl, if you start Postgres using a
relative path, then attempt to restart it from anywhere else, it
fails.

Example:

thom@swift /tmp $ pg_ctl -D primary start
server starting
thom@swift /tmp $ pg_ctl -D primary restart
waiting for server to shut down.... done
server stopped
server starting
thom@swift /tmp $ cd
thom@swift ~ $ pg_ctl -D /tmp/primary restart
waiting for server to shut down.... done
server stopped
server starting
thom@swift ~ $ postgres cannot access the server configuration file
"/home/thom/primary/postgresql.conf": No such file or directory

thom@swift ~ $ cd /tmp/primary
thom@swift /tmp/primary $ pg_ctl -D /tmp/primary restart
pg_ctl: PID file "/tmp/primary/postmaster.pid" does not exist
Is server running?
starting server anyway
server starting
thom@swift /tmp/primary $ postgres cannot access the server
configuration file "/tmp/primary/primary/postgresql.conf": No such
file or directory

thom@swift /tmp/primary $ cd ..
thom@swift /tmp $ pg_ctl -D /tmp/primary restart
pg_ctl: PID file "/tmp/primary/postmaster.pid" does not exist
Is server running?
starting server anyway
server starting


This issue does not occur if stopping then starting.  I suspect the
blame lies with postmaster.opts not storing the resolved absolute
path.

OS: Linux Mint 13 64-bit
PostgreSQL version: 9.1.6 at least (just the stable version I tested
on), and git master

--
Thom

pgsql-bugs by date:

Previous
From: Jan Vodička
Date:
Subject: Re: BUG #7590: Data corruption using pg_dump only with -Z parameter
Next
From: Craig Ringer
Date:
Subject: Re: BUG #7592: Installation of PostGresql at c:\Progam files folder does not create right permission on data folder