Received: from malur.postgresql.org ([2a02:16a8:dc51::56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqMXh-0001PL-SV for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Aug 2018 17:58:42 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1fqMXg-0001gZ-80 for pgsql-bugs@arkaria.postgresql.org; Thu, 16 Aug 2018 17:58:40 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.89) (envelope-from ) id 1fqMXf-0001gS-UR for pgsql-bugs@lists.postgresql.org; Thu, 16 Aug 2018 17:58:40 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1fqMXd-0002to-90 for pgsql-bugs@postgresql.org; Thu, 16 Aug 2018 17:58:38 +0000 Received: from bruce by momjian.us with local (Exim 4.84_2) (envelope-from ) id 1fqMXb-0000Cs-5y; Thu, 16 Aug 2018 13:58:35 -0400 Date: Thu, 16 Aug 2018 13:58:35 -0400 From: Bruce Momjian To: =?iso-8859-1?Q?Mart=EDn_Marqu=E9s?= Cc: DEGLAVE Remi , "pgsql-bugs@postgresql.org" , Michael Paquier Subject: Re: [PG_UPGRADE] 9.6 to 10.5 Message-ID: <20180816175835.GF4634@momjian.us> References: <20180810161245.GA7815@momjian.us> <15fa3462-a3da-2134-1c4e-8127f50ed304@2ndquadrant.com> <20180814212335.GD23476@momjian.us> <20180816163620.GE4634@momjian.us> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6c2NcOVqGQ03X4Wi" Content-Disposition: inline In-Reply-To: <20180816163620.GE4634@momjian.us> User-Agent: Mutt/1.5.23 (2014-03-12) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --6c2NcOVqGQ03X4Wi Content-Type: text/plain; charset=us-ascii Content-Disposition: inline On Thu, Aug 16, 2018 at 12:36:20PM -0400, Bruce Momjian wrote: > I think we just need to add an error message to say the server must be > shut down as a _primary_ server, not as a standby server, and we can > recommend to read the documentation on the use of rsync. Attached is a proposed patch. -- Bruce Momjian http://momjian.us EnterpriseDB http://enterprisedb.com + As you are, so once was I. As I am, so you will be. + + Ancient Roman grave inscription + --6c2NcOVqGQ03X4Wi Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="upgrade.diff" diff --git a/src/bin/pg_upgrade/controldata.c b/src/bin/pg_upgrade/controldata.c new file mode 100644 index f2f3ac5..c76de2c *** a/src/bin/pg_upgrade/controldata.c --- b/src/bin/pg_upgrade/controldata.c *************** get_control_data(ClusterInfo *cluster, b *** 150,157 **** /* remove leading spaces */ while (*p == ' ') p++; ! if (strcmp(p, "shut down\n") != 0 && ! strcmp(p, "shut down in recovery\n") != 0) { if (cluster == &old_cluster) pg_fatal("The source cluster was not shut down cleanly.\n"); --- 150,163 ---- /* remove leading spaces */ while (*p == ' ') p++; ! if (strcmp(p, "shut down in recovery\n") == 0) ! { ! if (cluster == &old_cluster) ! pg_fatal("The source cluster was shut down while in recovery mode. To upgrade it, use \"rsync\" or shut it down as a primary.\n"); ! else ! pg_fatal("The target cluster was shut down while in recovery mode. To upgrade it, use \"rsync\" or shut it down as a primary.\n"); ! } ! else if (strcmp(p, "shut down\n") != 0) { if (cluster == &old_cluster) pg_fatal("The source cluster was not shut down cleanly.\n"); --6c2NcOVqGQ03X4Wi--