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 1l2ITW-0002Wt-WE for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jan 2021 18:45:03 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1l2ITV-0002Aj-Lr for pgsql-hackers@arkaria.postgresql.org; Wed, 20 Jan 2021 18:45:01 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2ITU-0002AJ-L4 for pgsql-hackers@lists.postgresql.org; Wed, 20 Jan 2021 18:45:01 +0000 Received: from wout2-smtp.messagingengine.com ([64.147.123.25]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1l2ITO-0007ug-1H for pgsql-hackers@postgresql.org; Wed, 20 Jan 2021 18:44:59 +0000 Received: from compute2.internal (compute2.nyi.internal [10.202.2.42]) by mailout.west.internal (Postfix) with ESMTP id 167CC19F5; Wed, 20 Jan 2021 13:44:52 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute2.internal (MEProxy); Wed, 20 Jan 2021 13:44:52 -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=srumI5Deu1soqG1UERXW3PDDIzuzeoxP7Z+mG7I5aS4=; b=dJmCpvO4 cefYLrjb4JuqSgYlOm6bHNjliS8IpfKOUB2IZ/OJqICZmaPMeInk6j5a60SvoH5K ar0xacE2uMCQaj/THHkG5O4AApGCPMvNRWid1BNlhxbbjL+3izld3reUkLy5NREp e14g3W6Z+HeUQEs6W77fqGZnnm+fQF7nBVBvtVvtHlvDnOMUKnSGN55J9zYDu3Pg f9o9ytpciPA8pUJoVgMlhME5wjwfw9Dy9Nf/819yyUzS5loNLdLUUYsOVjV3T0Sm /N7uD+CFy7Iavf+R60ZdttK+HQu03q36wZuwQ1MFPcwMAvRSHW8EJKkN6XNZDwpM U3F0QRZaybagtA== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduledruddvgdduudekucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmne cujfgurhepfffhvffukfggtggugfgjfgesmhekreertderudenucfhrhhomheptehlvhgr rhhoucfjvghrrhgvrhgruceorghlvhhhvghrrhgvsegrlhhvhhdrnhhoqdhiphdrohhrgh eqnecuggftrfgrthhtvghrnhephfefgeelkefgjeeuhefgfeevleeftedvhefftdeutefg hfekhfduheffkeduteeknecukfhppeduledtrdelhedrudelrddujeejnecuvehluhhsth gvrhfuihiivgeptdenucfrrghrrghmpehmrghilhhfrhhomheprghlvhhhvghrrhgvsegr lhhvhhdrnhhoqdhiphdrohhrgh X-ME-Proxy: Received: from perhan.alvh.no-ip.org (unknown [190.95.19.177]) by mail.messagingengine.com (Postfix) with ESMTPA id ED9FD240065; Wed, 20 Jan 2021 13:44:50 -0500 (EST) Received: by perhan.alvh.no-ip.org (Postfix, from userid 1000) id 4E1252A0FBF; Wed, 20 Jan 2021 15:44:46 -0300 (-03) Date: Wed, 20 Jan 2021 15:44:46 -0300 From: Alvaro Herrera To: Robert Haas Cc: Tom Lane , "pgsql-hackers@postgresql.org" Subject: Re: strange error reporting Message-ID: <20210120184446.GA22263@alvherre.pgsql> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="qMm9M+Fa2AknHoGS" 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 --qMm9M+Fa2AknHoGS 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:25 PM Alvaro Herrera wrote: > > That's because pgbench reports the input argument dbname, but since you > > didn't specify anything, then PQconnectdbParams() uses the libpq > > behavior. I think we'd have to use PQdb() instead. > > I figured it was something like that. I don't know whether the right > thing is to use something like PQdb() to get the correct database > name, or whether we should go with Tom's suggestion and omit that > detail altogether, but I think showing the empty string when the user > relied on the default is too confusing. Well, the patch seems small enough, and I don't think it'll be in any way helpful to omit that detail. -- Álvaro Herrera 39°49'30"S 73°17'W "Having your biases confirmed independently is how scientific progress is made, and hence made our great society what it is today" (Mary Gardiner) --qMm9M+Fa2AknHoGS Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="pgbench-db.patch" diff --git a/src/bin/pgbench/pgbench.c b/src/bin/pgbench/pgbench.c index f7da3e1f62..30fde9e9ec 100644 --- a/src/bin/pgbench/pgbench.c +++ b/src/bin/pgbench/pgbench.c @@ -1226,7 +1226,7 @@ doConnect(void) if (PQstatus(conn) == CONNECTION_BAD) { pg_log_error("connection to database \"%s\" failed: %s", - dbName, PQerrorMessage(conn)); + PQdb(conn), PQerrorMessage(conn)); PQfinish(conn); return NULL; } --qMm9M+Fa2AknHoGS--