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 1slwt4-0029s1-VH for pgsql-docs@arkaria.postgresql.org; Wed, 04 Sep 2024 20:45:59 +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 1slwt3-00F330-J2 for pgsql-docs@arkaria.postgresql.org; Wed, 04 Sep 2024 20:45:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slwt3-00F31S-As for pgsql-docs@lists.postgresql.org; Wed, 04 Sep 2024 20:45:57 +0000 Received: from sss.pgh.pa.us ([68.162.161.243]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1slwt1-000ARO-6F for pgsql-docs@lists.postgresql.org; Wed, 04 Sep 2024 20:45:56 +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 484KjsIM1692843; Wed, 4 Sep 2024 16:45:54 -0400 From: Tom Lane To: alain.bourgeois@zetes.com cc: pgsql-docs@lists.postgresql.org Subject: Re: pg_upgrade -c cannot be run if old cluster is running In-reply-to: <172546462173.8361.7114078895863039790@wrigleys.postgresql.org> References: <172546462173.8361.7114078895863039790@wrigleys.postgresql.org> Comments: In-reply-to PG Doc comments form message dated "Wed, 04 Sep 2024 15:43:41 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1692841.1725482754.1@sss.pgh.pa.us> Date: Wed, 04 Sep 2024 16:45:54 -0400 Message-ID: <1692842.1725482754@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Doc comments form writes: > https://www.postgresql.org/docs/15/pgupgrade.html tells > "You can use pg_upgrade --check to perform only the checks, even if the old > server is still running." I tested this case, and it seems to work for me. pg_upgrade will try to start a server in the old data directory, but if that fails it will assume that there's a live server to run the checks against. > waiting for server to start....2024-09-04 12:08:32.179 CEST [12197] FATAL: > lock file "postmaster.pid" already exists > 2024-09-04 12:08:32.179 CEST [12197] HINT: Is another postmaster (PID > 25407) running in data directory "/mnt/pgdata/pgdir"? > stopped waiting > pg_ctl: could not start server > Examine the log output. What I suspect happened here is some confusion about where the lock file is, leading to not recognizing that there was possibly an old live server. You didn't supply enough detail to reproduce the problem, but perhaps check whether the old and new Postgres versions were built with similar options. regards, tom lane