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 1l4UOK-0007eK-PR for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jan 2021 19:52:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l4UOJ-0006NH-BZ for pgsql-hackers@arkaria.postgresql.org; Tue, 26 Jan 2021 19:52:43 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4UOI-0006NA-LK for pgsql-hackers@lists.postgresql.org; Tue, 26 Jan 2021 19:52:43 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l4UO8-0000RQ-Pg for pgsql-hackers@postgresql.org; Tue, 26 Jan 2021 19:52:39 +0000 Received: from compute3.internal (compute3.nyi.internal [10.202.2.43]) by mailout.west.internal (Postfix) with ESMTP id 9F1A8952; Tue, 26 Jan 2021 14:52:28 -0500 (EST) Received: from mailfrontend2 ([10.202.2.163]) by compute3.internal (MEProxy); Tue, 26 Jan 2021 14:52:28 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:subject:to :x-me-proxy:x-me-proxy:x-me-sender:x-me-sender:x-sasl-enc; s= fm1; bh=uwoFN0HpqY9W3cZi2GbsDsNOXkb2r6PROPuGJTczoTU=; b=nxXi0Xwo flJGZE4AYv6dbwm+Zz0tjCIob2suRZm5A4Nh/U+DCc67M6v0ZUT5AdKde8oEe6VY /tRTR5lWRUhHI0vokFufnj1tgD5JkifDtXxSRiDVAMpc6HGQ+9X1LvA8qr8MsV5B /mwv+tlsUXIp6ZkfGf5i4hvnZNvKobcmdNeTb3bIBKELUxoOokj6SnGSyt7wqgnW yctUAzWB3vUWbm7d9F72cl8IvA/F10NgXYMhTnjDdSCytHZ6ODUYs8ZgYA7/SOVi pbArthrBntoKQ/kE4YaGa1clapTAZYO+/vmPqE5600dSc+tYHVL4YMbeyg5rbGQ+ +8HBteZ/aIkTbQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledrvdeigdeikecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpeffhffvuffkgggtugfgjggfsehmkeerredtredunecuhfhrohhmpeetlhhvrghr ohcujfgvrhhrvghrrgcuoegrlhhvhhgvrhhrvgesrghlvhhhrdhnohdqihhprdhorhhgqe enucggtffrrghtthgvrhhnpedvvedvgfffheekhfdvleefvdetfeeiueffieegieevgfeh tdeftdelfefggfdtgfenucffohhmrghinhepphhoshhtghhrvghsqhhlrdhorhhgnecukf hppeduledtrdelhedrudelrddujeejnecuvehluhhsthgvrhfuihiivgeptdenucfrrghr rghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id B72AD108005C; Tue, 26 Jan 2021 14:52:27 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id F1A512A0FAE; Tue, 26 Jan 2021 16:52:24 -0300 (-03) Date: Tue, 26 Jan 2021 16:52:24 -0300 From: Alvaro Herrera To: Robert Haas Cc: Tom Lane , "pgsql-hackers@postgresql.org" Subject: Re: strange error reporting Message-ID: <20210126195224.GA20361@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="yrj/dFKFPuw6o+aM" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --yrj/dFKFPuw6o+aM Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit On 2021-Jan-20, Robert Haas wrote: > On Wed, Jan 20, 2021 at 1:54 PM Tom Lane wrote: > > Alvaro Herrera writes: > > > Well, the patch seems small enough, and I don't think it'll be in any > > > way helpful to omit that detail. > > > > I'm +1 for applying and back-patching that. I still think we might > > want to just drop the phrase altogether in HEAD, but we wouldn't do > > that in the back branches, and the message is surely misleading as-is. > > Sure, that makes sense. OK, I pushed it. Thanks, pgbench has one occurrence of the old pattern in master, in line 6043. However, since doConnect() returns NULL when it gets CONNECTION_BAD, that seems dead code. This patch kills it. -- Álvaro Herrera 39°49'30"S 73°17'W "I can see support will not be a problem. 10 out of 10." (Simon Wittber) (http://archives.postgresql.org/pgsql-general/2004-12/msg00159.php) --yrj/dFKFPuw6o+aM Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="deadcode.patch" diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index 1be1ad3d6d..a4a3f40048 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -6038,17 +6038,10 @@ main(int argc, char **argv) /* opening connection... */ con = doConnect(); if (con == NULL) exit(1); - if (PQstatus(con) == CONNECTION_BAD) - { - pg_log_fatal("connection to database \"%s\" failed: %s", - dbName, PQerrorMessage(con)); - exit(1); - } - if (internal_script_used) GetTableInfo(con, scale_given); /* * :scale variables normally get -s or database scale, but don't override --yrj/dFKFPuw6o+aM--