Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.92) (envelope-from ) id 1j6lop-0000SF-U6 for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Feb 2020 01:49:01 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1j6lon-0002Vk-LR for pgsql-hackers@arkaria.postgresql.org; Wed, 26 Feb 2020 01:48:57 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1j6lol-0002Rc-I2 for pgsql-hackers@lists.postgresql.org; Wed, 26 Feb 2020 01:48:57 +0000 Received: from out2-smtp.messagingengine.com ([66.111.4.26]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j6loh-0000Qd-Ux for pgsql-hackers@lists.postgresql.org; Wed, 26 Feb 2020 01:48:54 +0000 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 666C221E6A; Tue, 25 Feb 2020 20:48:50 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute4.internal (MEProxy); Tue, 25 Feb 2020 20:48:50 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=paquier.xyz; h= date:from:to:cc:subject:message-id:references:mime-version :content-type:in-reply-to; s=fm1; bh=q11txBUS7Im0Cf+ZLI5YoXtsfDf xVi7AhH1oLuPT8D0=; b=D9uKcNgY7RMhnAHgtlhaI10q55HIDkttNdjeDWhU6Vx IPt8lRaFyMQLyDr7hlxczVPe1hlHdegBKq55H8EEDRX444ctD8Uj1x+dKLHsmXVU fFz1Tq54NiFFQkrU8a4Fau/xwlr4mA8BFEWg4h7Y7T5Vfs3sJVyA2dGbsyiPJNzh umhGMLdlSnn7mw2NItapqifc4GTzar7q8HVsaxgy2bsZAIKwl7C+KZyuGV+aWWzF x6C3gbEFvPJlD3FzNLa2P4NGNUNsDYZVUJ6YPUxzb2ZsjGjVyjL71QVNt7UJD7AP 76nIacRvy5VFDMiN658ZIcGL23IST2vglnlflSZffhA== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-proxy :x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s=fm2; bh=q11txB US7Im0Cf+ZLI5YoXtsfDfxVi7AhH1oLuPT8D0=; b=0pKYV2OwST/tSOE6uxId5S AZ6nn80PSHwvGKwwE9XZ1IEWGlMyO2WC1TTY1Vny+ov9yn0nq6SMsD9UhWE+uAS2 JvME5Lg+TbQfqYjcvoxB5OT4qBE2hFqDlhx5HIIQQIoI2LWboKLBSP/pNIUkEM6G JyJcvriVR2e2/epg97VbBv2RKO8ygc4wWUandYUNaAyq8sxZ8e04fFrgFPmVBZ1+ qlwKVgXUrhd56f6Tacw9sV2By7k9JM2C1+qpPdS6yGyPIQBvJRoalEax70Ev2Iuc T1jmhVxhdDCKe85WX3OqCUR5Al8lczCmsuryFjU/Xni/efJi1qJt2tRaCYOX0RMg == X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedugedrleefgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenfg hrlhcuvffnffculdejtddmnecujfgurhepfffhvffukfhfgggtuggjsehgtderredttddu necuhfhrohhmpefoihgthhgrvghlucfrrghquhhivghruceomhhitghhrggvlhesphgrqh huihgvrhdrgiihiieqnecukfhppeduuddurddutddvrddukedtrddukeehnecuvehluhhs thgvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomhepmhhitghhrggvlhesph grqhhuihgvrhdrgiihii X-ME-Proxy: Received: from paquier.xyz (ee0822lan1.rev.em-net.ne.jp [111.102.180.185]) by mail.messagingengine.com (Postfix) with ESMTPA id 7C58B30610DB; Tue, 25 Feb 2020 20:48:48 -0500 (EST) Date: Wed, 26 Feb 2020 10:48:44 +0900 From: Michael Paquier To: Dagfinn Ilmari =?iso-8859-1?Q?Manns=E5ker?= Cc: Daniel Gustafsson , pgsql-hackers@lists.postgresql.org Subject: Re: [PATCH] pg_upgrade: report the reason for failing to open the cluster version file Message-ID: <20200226014844.GF17153@paquier.xyz> References: <87pne2w98h.fsf@wibble.ilmari.org> <44115C15-EE49-4BDE-A976-2901384B5E60@yesql.se> <87mu96w7c5.fsf@wibble.ilmari.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha512; protocol="application/pgp-signature"; boundary="JcvBIhDvR6w3jUPA" Content-Disposition: inline In-Reply-To: <87mu96w7c5.fsf@wibble.ilmari.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --JcvBIhDvR6w3jUPA Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable On Tue, Feb 25, 2020 at 11:55:06PM +0000, Dagfinn Ilmari Manns=E5ker wrote: > @@ -164,11 +164,11 @@ get_major_server_version(ClusterInfo *cluster) > snprintf(ver_filename, sizeof(ver_filename), "%s/PG_VERSION", > cluster->pgdata); > if ((version_fd =3D fopen(ver_filename, "r")) =3D=3D NULL) > - pg_fatal("could not open version file: %s\n", ver_filename); > + pg_fatal("could not open version file \"%s\": %m\n", ver_filename); Here I think that it would be better to just use "could not open file" as we know that we are dealing with a version file already thanks to ver_filename. > if (fscanf(version_fd, "%63s", cluster->major_version_str) =3D=3D 0 || > sscanf(cluster->major_version_str, "%d.%d", &v1, &v2) < 1) > - pg_fatal("could not parse PG_VERSION file from %s\n", cluster->pgdata); > + pg_fatal("could not parse PG_VERSION file from \"%s\"\n", cluster->pgd= ata); > =20 > fclose(version_fd); No objection to this one. -- Michael --JcvBIhDvR6w3jUPA Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAABCgAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAl5VznwACgkQnvQgOdby QH2Qdw//XLAK7bSVgtoyCjNxUsFLjEaU6HhKaYyG4zmOIybciSzDU+02xe4glde5 XVMozr6F0D1Fc44jXm55v0PnVpuVrxUmm0r+Qm6CLC0s8mv1akwvqnXxplvbSkO8 tK35QINxQFOk7kNS7SNw7kO3jRQUSzipY/mv9MJwcA8z83PUEPVKPDaeDKX9C/6o F+jgmKCcvWlGfsazGOQoAdFulw/sWD09uvIXipncxbsvm1Iu6iDYXlE83nhHUqFT 3+LOuHY/69vkmbuWBXULCflbFSa0TUI8vBfQ4PAmuRzmUTAi9CRsTVgQHkzdKxZg 9nUNfqfTeVFAZeQx60cp5T9IgadOlH0u3B7IPMasQhxvuvAeiyf3RXhKreBpqpD+ N87wRqdUfNQZyHrwYm04WgbihwMFQEIS7UhJga5I98ci3J4+LampCskF03/PWjCL 3SCgEbqfDQhpYbl79IOQHl39xXjQG0fnxpFck0oyLzH+vs++p50Q77pb8gu6Bw+k EDH2qJHqzAY7KEsT5STMpK93M14CfQhTBZ5mz5cXCekIzRgPkTI57puaFYRIqgl9 nXrbDjk7uuC7ZRQGpmpPJxJ1E+UEoCjlt6lBl7PrWU441TWYM6RucLB9PcZgOxO8 vKU9v1E3PWLga1jS04+Y7fV+wNhrxOGdOWcAffooAEmE3A7LR5s= =pxK2 -----END PGP SIGNATURE----- --JcvBIhDvR6w3jUPA--