Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smDv4-0049I4-AB for pgsql-docs@arkaria.postgresql.org; Thu, 05 Sep 2024 14:57:10 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1smDv2-00C0DL-R0 for pgsql-docs@arkaria.postgresql.org; Thu, 05 Sep 2024 14:57:09 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smDv2-00C0DD-JC for pgsql-docs@lists.postgresql.org; Thu, 05 Sep 2024 14:57:08 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1smDv0-000Ip0-JO for pgsql-docs@lists.postgresql.org; Thu, 05 Sep 2024 14:57:08 +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 485Ev4VK1845284; Thu, 5 Sep 2024 10:57:05 -0400 From: Tom Lane To: Alain Bourgeois cc: pgsql-docs@lists.postgresql.org Subject: Re: pg_upgrade -c cannot be run if old cluster is running In-reply-to: References: <172546462173.8361.7114078895863039790@wrigleys.postgresql.org> <1692842.1725482754@sss.pgh.pa.us> <1827652.1725543542@sss.pgh.pa.us> Comments: In-reply-to Alain Bourgeois message dated "Thu, 05 Sep 2024 14:32:32 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1845282.1725548224.1@sss.pgh.pa.us> Content-Transfer-Encoding: quoted-printable Date: Thu, 05 Sep 2024 10:57:04 -0400 Message-ID: <1845283.1725548224@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk [ Please keep the mailing list cc'd ] Alain Bourgeois writes: > I confirm copyig config to data dir and specifying data dir works > /usr/pgsql-15/bin/pg_upgrade --check -b /usr/pgsql-10/bin/ -B /usr/pgsql= -15/bin -d /mnt/pgdata/pgdir -D /mnt/pgdata/pgdirbc15 --check Hm. On second look, there is code in there that intends to deal with -d pointing at a configuration-only directory, and it seems to work for me: $ pg_upgrade --check -d /home/postgres/version10/config ...etc... Finding the real data directory for the source cluster ok Performing Consistency Checks on Old Live Server ------------------------------------------------ Checking cluster versions ok Checking database user is the install user ok Checking database connection settings ok ... The lack of any comment about "Finding the real data directory" in your output is suspicious. I notice that the code that does this has a short-circuit case that perhaps could get fooled: /* If PG_VERSION exists, it can't be a config-only dir */ snprintf(filename, sizeof(filename), "%s/PG_VERSION", cluster->pgconfi= g); if ((fp =3D fopen(filename, "r")) !=3D NULL) { fclose(fp); return; } Do you have a PG_VERSION file in /var/lib/pgsql/10/data? If so, why? regards, tom lane