RE: Problems with new data location

From: "Karen Ellrick" <k-ellrick(at)sctech(dot)co(dot)jp>
To: <pgsql-general(at)postgresql(dot)org>
Subject: RE: Problems with new data location
Date: 2001-05-30 04:48:55
Message-ID: GAELLCMOCEGMDMHDMIILEEHCCIAA.k-ellrick@sctech.co.jp
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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,
(3) start.

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.

Karen

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Kapil Tilwani 2001-05-30 06:13:19 Re: [GENERAL]
Previous Message Dr. Evil 2001-05-30 02:58:11 Preventing variables from "rolling over"