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

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: (view raw, whole thread or download thread mbox)
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/ - 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.


In response to


pgsql-general by date

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

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