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:28:25
Message-ID: AE23054D-CF6E-4E69-A4F6-43B0681B57CE@u.washington.edu
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

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.

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?

-Shawn

> On Feb 15, 2017, at 9:09 AM, Magnus Hagander <magnus(at)hagander(dot)net> wrote:
>
> On Wed, Feb 15, 2017 at 6:03 PM, Shawn Thomas <thomassd(at)u(dot)washington(dot)edu <mailto:thomassd(at)u(dot)washington(dot)edu>> wrote:
> /usr/lib/postgresql/9.4/bin/pg_ctl: No such file or directory
>
> postgres(at)pangaea:/usr/lib/postgresql/9.4/bin$ ls -al
> total 4008
> drwxr-xr-x 2 root root 4096 Feb 9 16:17 .
> drwxr-xr-x 3 root root 4096 Feb 9 16:17 ..
> -rwxr-xr-x 1 root root 68128 Nov 16 06:53 clusterdb
> -rwxr-xr-x 1 root root 68192 Nov 16 06:53 createdb
> -rwxr-xr-x 1 root root 63920 Nov 16 06:53 createlang
> -rwxr-xr-x 1 root root 72672 Nov 16 06:53 createuser
> -rwxr-xr-x 1 root root 63936 Nov 16 06:53 dropdb
> -rwxr-xr-x 1 root root 63920 Nov 16 06:53 droplang
> -rwxr-xr-x 1 root root 63904 Nov 16 06:53 dropuser
> -rwxr-xr-x 1 root root 68416 Nov 16 06:53 pg_basebackup
> -rwxr-xr-x 1 root root 351904 Nov 16 06:53 pg_dump
> -rwxr-xr-x 1 root root 2186504 Nov 16 06:53 pg_dumpall
> -rwxr-xr-x 1 root root 30992 Nov 16 06:53 pg_isready
> -rwxr-xr-x 1 root root 47600 Nov 16 06:53 pg_receivexlog
> -rwxr-xr-x 1 root root 51928 Nov 16 06:53 pg_recvlogical
> -rwxr-xr-x 1 root root 154944 Nov 16 06:53 pg_restore
> -rwxr-xr-x 1 root root 515320 Nov 16 06:53 psql
> -rwxr-xr-x 1 root root 68160 Nov 16 06:53 reindexdb
> -rwxr-xr-x 1 root root 72384 Nov 16 06:53 vacuumdb
>
> As I mentioned, this Debian package removes pg_ctl from the bin directory and instead attempts to wrap the pg_ctl functionality in a perl script so that the PG process is integrated with systemd. I really wish they hadn’t, and it’s part of the reason I’m where I’m at.
>
> pg_ctl is normally present in /usr/lib/postgresql/<version>/bin on a debian system. If that is gone, somebody removed it, or you didn't install the "postgresql-9.4" package which provides it. On a 9.4 system:
>
> $ dpkg -S /usr/lib/postgresql/9.4/bin/pg_ctl
> postgresql-9.4: /usr/lib/postgresql/9.4/bin/pg_ctl
>
> You could try reinstalling the postgresql-9.4 package and see if it comes back. The rest of the binaries in that directory seems to be from postgresql-9.4-client though -- have you actually by mistake uninstalled the server package completely?
>
> As in, that directory is supposed to have the "postgres" binary which is the database server and it's not there. So there is no wonder it's not starting...
>
> --
> 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 Tim Bellis 2017-02-15 17:30:48 Autovacuum stuck for hours, blocking queries
Previous Message Joshua D. Drake 2017-02-15 17:28:08 Re: Can't restart Postgres