Tom Lane wrote:
> But ... um ... did you restart the postmaster with the new path argument?
> Or only change the script?
Well, now I can't remember the exact sequence I used originally - I probably
tried to restart only after all the changes had taken place. I do remember
getting the error "can't find /usr/local/pgsql/data/postmaster.pid - is
postmaster running?", and dummy me, I assumed it wasn't, without checking
ps. Anyway, restarting doesn't seem to work if I actually move the
directory rather than copy it. But after I got your message, I checked ps
and discovered that indeed, postmaster was still running. So I put the
directory back in its old place, successfully ran "pg_ctl -D
/usr/local/pgsql/data stop", then moved the directory, and then successfully
ran "pg_ctl -D /var/pgdata stop".
> BTW, it should work fine to move a data-directory tree from one place to
> another (with cp -p -r or tar/untar according to preference). But you
> have to shut down the old postmaster *first*.
Yup, the key is that both those methods copy (rather than move) the
directory. If you copy, you can use restart (I assume - I didn't try it).
If you want to simply move the directory, you have to (1) stop, (2) move,
Thanks for pointing me in the right direction, and also giving me the
assurance that a data directory can indeed be moved without redoing initdb.
In response to
pgsql-general by date
|Next:||From: Kapil Tilwani||Date: 2001-05-30 06:13:19|
|Subject: Re: [GENERAL]|
|Previous:||From: Dr. Evil||Date: 2001-05-30 02:58:11|
|Subject: Preventing variables from "rolling over"|