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

postmaster.opts, moving datadir around, and pg_ctl

From: David Garamond <lists(at)zara(dot)6(dot)isreserved(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: postmaster.opts, moving datadir around, and pg_ctl
Date: 2004-07-25 12:45:19
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
I had datadir in /dir1 and I started postmaster with:

  postmaster -D /dir1

this recorded "-D /dir1" in /dir1/postmaster.opts. Then I stopped 
postmaster and moved /dir1 to /dir2. I then started postmaster with:

  PG_DATA=/dir2 pg_ctl start

It worked normally. But:

  PG_DATA=/dir2 pg_ctl restart

failed when starting postmaster because it used datadir from 
postmaster.opts (/dir1). This worked though:

  pg_ctl restart -D /dir2

So there's a slight inconsistency between the start and restart command.

Would it be nicer if postmaster doesn't record -D in postmaster.opts, or 
if pg_ctl strips it? Or is it entirely my fault for not adjusting 
postmaster.opts when I move datadir around? IMO it would be nice if 
datadir is portable (i.e. it doesn't contain its own full path).

Also pardon my ignorance, but what is the purpose of having 
postmaster.opts inside datadir?

This is postgresql 7.4.3 on Linux.


pgsql-hackers by date

Next:From: David GaramondDate: 2004-07-25 12:45:22
Subject: pg_ctl and failing postmaster
Previous:From: Andrew DunstanDate: 2004-07-25 12:32:48
Subject: Re: [HACKERS] 7.5 release notes

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