Re: Trouble starting Postgresql after an upgrade

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Kevin Brannen <KBrannen(at)efji(dot)com>
Cc: "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trouble starting Postgresql after an upgrade
Date: 2016-07-14 17:01:39
Message-ID: 7112.1468515699@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Kevin Brannen <KBrannen(at)efji(dot)com> writes:
> Im having a little trouble and I hope someone can point me towards a fix.
> Weve been using Pg 9.3.4 and just upgraded to 9.5.1. Ive installed it on 1 server and it works. However, when I copied those binaries over to a 2nd server, I find that they wont start normally. I can do /etc/init.d/postgresql-9.5 start from anywhere and it fails to start. Looking in the script, I believe the important line (expanded via bash -x) is:

> + echo -n 'Starting postgresql-9.5 service: '
> Starting postgresql-9.5 service: + runuser -l postgres -c '/opt/pgsql-9.5/bin/postmaster -p '\''5432'\'' -D '\''/nms-db/9.5/data'\'' &'

> In the pgstartup.log, I see:

> LOG: skipping missing configuration file "/home/postgres/postgresql.auto.conf"
> 2016-07-12 22:16:41 GMT [6066]: [2-1] user=,db=,app= FATAL: "/home/postgres" is not a valid data directory
> 2016-07-12 22:16:41 GMT [6066]: [3-1] user=,db=,app= DETAIL: File "/home/postgres/PG_VERSION" is missing.

The postmaster is evidently deciding that /home/postgres is supposed to be
the data directory. The only theory I can think of to explain this is
that /nms-db/9.5/data contains a postgresql.conf file that sets
data_directory in a way that resolves as that. It is definitely finding
a postgresql.conf somewhere, else you'd not have gotten this far.

> To make the problem more interesting, I can bring the DB engine up if I use pg_ctl but only if Im in the data dir.

Possibly you have "data_directory = ." or something like that in the
config file?

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Kevin Brannen 2016-07-14 17:43:11 Re: Trouble starting Postgresql after an upgrade
Previous Message Adrian Klaver 2016-07-14 16:48:29 Re: Trouble starting Postgresql after an upgrade