Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olshT-0001zc-Ny for pgsql-general@arkaria.postgresql.org; Fri, 21 Oct 2022 14:08:39 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1olshQ-0000x0-VR for pgsql-general@arkaria.postgresql.org; Fri, 21 Oct 2022 14:08:36 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olshQ-0000vR-Jt for pgsql-general@lists.postgresql.org; Fri, 21 Oct 2022 14:08:36 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1olshN-0003d4-Mx for pgsql-general@postgresql.org; Fri, 21 Oct 2022 14:08:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 29LE8VBp3193942; Fri, 21 Oct 2022 10:08:31 -0400 From: Tom Lane To: chris navarroza cc: pgsql-general@postgresql.org Subject: Re: Upgrading error In-reply-to: References: Comments: In-reply-to chris navarroza message dated "Fri, 21 Oct 2022 15:52:15 +0800" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <3193940.1666361311.1@sss.pgh.pa.us> Date: Fri, 21 Oct 2022 10:08:31 -0400 Message-ID: <3193941.1666361311@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk chris navarroza 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