Re: Upgrading error - Mailing list pgsql-general

From Tom Lane
Subject Re: Upgrading error
Date
Msg-id 3193941.1666361311@sss.pgh.pa.us
Whole thread Raw
In response to Upgrading error  (chris navarroza <canavarroza.work@gmail.com>)
Responses Re: Upgrading error
List pgsql-general
chris navarroza <canavarroza.work@gmail.com> writes:
> bash-4.4$ /usr/pgsql-14/bin/pg_upgrade
> --old-datadir=/home/dmartuser/pgdata/data/
> --new-datadir=/home/dmartuser/pgdata/data/ --old-bindir=/usr/pgsql-12/bin/
> --new-bindir=/usr/pgsql-14/bin/ --check --verbose
> Running in verbose mode
> Performing Consistency Checks
> -----------------------------
> Checking cluster versions
> This utility can only upgrade to PostgreSQL version 14.

You cannot use the same directory as --old-datadir and --new-datadir.
I think pg_upgrade is unhappy because what it sees in PG_VERSION in
the --new-datadir isn't v14 ... but I wonder if we shouldn't be
checking for this mistake more directly.

Anyway, the right way to proceed is to use v14's initdb to create
a new directory at, say, /home/dmartuser/pgdata/data-14
and then pg_upgrade to that.  Afterwards you can rename the old
data directory out of the way and move the new one to
/home/dmartuser/pgdata/data, if you like.

            regards, tom lane



pgsql-general by date:

Previous
From: chris navarroza
Date:
Subject: Upgrading error
Next
From: Laurenz Albe
Date:
Subject: Re: Mysterious performance degradation in exceptional cases