pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: chris navarroza <canavarroza.work@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Upgrading error
Date: Fri, 21 Oct 2022 10:08:31 -0400
Message-ID: <3193941.1666361311@sss.pgh.pa.us> (raw)
In-Reply-To: <CADRdQ7r7t1sDYRSc79aSzFG3U-cS1VY_4X_sYBhibQcSG2roNg@mail.gmail.com>
References: <CADRdQ7r7t1sDYRSc79aSzFG3U-cS1VY_4X_sYBhibQcSG2roNg@mail.gmail.com>

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





view thread (5+ messages)  latest in thread

Message-ID: <3193941.1666361311@sss.pgh.pa.us>
Permalink:  ../3193941.1666361311@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/3193941.1666361311@sss.pgh.pa.us

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: tgl@sss.pgh.pa.us, canavarroza.work@gmail.com
  Subject: Re: Upgrading error
  In-Reply-To: <3193941.1666361311@sss.pgh.pa.us>
  References: <CADRdQ7r7t1sDYRSc79aSzFG3U-cS1VY_4X_sYBhibQcSG2roNg@mail.gmail.com> <3193941.1666361311@sss.pgh.pa.us>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox