Re: Can't restart Postgres

From: Shawn Thomas <thomassd(at)u(dot)washington(dot)edu>
To: Magnus Hagander <magnus(at)hagander(dot)net>
Cc: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>, Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Can't restart Postgres
Date: 2017-02-15 17:45:50
Message-ID: 4049504B-D235-4081-AAE8-A8CCD9E329ED@u.washington.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Which would you recommend? Leave the data directory in place and re-install PG or copy it to somewhere else, delete it and then re-install PG?

-Shawn

> On Feb 15, 2017, at 9:36 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>
> On Wed, Feb 15, 2017 at 6:28 PM, Shawn Thomas <thomassd(at)u(dot)washington(dot)edu <mailto:thomassd(at)u(dot)washington(dot)edu>> wrote:
> Well that would make more sense of things. I had removed and re-installed the postresql-common package:
>
> https://packages.debian.org/jessie/postgresql-common <https://packages.debian.org/jessie/postgresql-common>
>
> and thought that it would leave the main PG package in place. But perhaps I was wrong. I’ll follow Tom’s advice and just re-install everything (saving the old data directory) and hope the new installation can use the old data data directory.
>
> If you removed it and then installed it, then the removal would remove all dependent packages and if you then only intalled that one and not the dependencies that would explain it.
>
> If you had run a reinstall on it, then it would've kept them around.
>
>
> One question about this approach though: the Debian package installation automatically initializes the new data directory and starts PG. If I shut it down and copy the old data directory into the newly installed one, will there be an xlog issue?
>
> You have to copy the xlog along with the database.
>
> Or if you leave it in place where it is, the packages won't initialize a new data directory.
>
> --
> Magnus Hagander
> Me: http://www.hagander.net/ <http://www.hagander.net/>
> Work: http://www.redpill-linpro.com/ <http://www.redpill-linpro.com/>

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adrian Klaver 2017-02-15 17:49:35 Re: Can't restart Postgres
Previous Message Adrian Klaver 2017-02-15 17:38:19 Re: Can't restart Postgres