My bluff please ignore. I set wrong pg directory in PATH.
On Wed 15 Aug, 2018, 1:54 AM Bruce Momjian, <bruce@xxxxxxxxxx> wrote:
On Wed, Aug 15, 2018 at 12:20:27AM +0530, Debraj Manna wrote:
> Hi
>
> I am trying to upgrade to postgres 10 from postgres 9.5.4. But on trying to run
> pg_upgrade I am getting the below error
>
> ubuntu@vrni-platform:/tmp$ sudo -H -u postgres /usr/lib/postgresql/10/bin/
> pg_upgrade -b /usr/lib/postgresql/9.5/bin -B /usr/lib/postgresql/10/bin -d /var
> /lib/postgresql/data/postgresql0 -D /var/lib/postgresql/10/data/postgresql0 -o
> ' -c config_file=/etc/postgresql/9.5/main/postgresql.conf' -O ' -c config_file=
> /etc/postgresql/10/main/postgresql.conf' --check -k
>
> check for "/usr/lib/postgresql/10/bin/pg_resetxlog" failed: No such file or
> directory
> Failure, exiting
>
> Can someone let me know what is going wrong and how can I use the pg_upgrade?
Uh, that is an unusual error. What PG 10 version is that, exactly?
10.4? 10.5? We added new code to test for proper server shutdown in PG
10.5, but that used pg_controldata, so I don't think that is the cause.
I think the problem is suggested in this part of the code:
/* pg_resetxlog has been renamed to pg_resetwal in version 10 */
if (GET_MAJOR_VERSION(cluster->bin_version) < 1000)
validate_exec(cluster->bindir, "pg_resetxlog");
else
validate_exec(cluster->bindir, "pg_resetwal");
It should be looking for /usr/lib/postgresql/10/bin/pg_resetwal
---
which I bet does exist. I have no idea why this would be testing for
pg_resetxlog in a path that expect PG 10. Maybe some of the directories
are not the PG versions you think they are.
--
Bruce Momjian <bruce@xxxxxxxxxx> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ As you are, so once was I. As I am, so you will be. +
+ Ancient Roman grave inscription +