Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZBmmT-0000nA-LJ for pgsql-bugs@arkaria.postgresql.org; Sun, 05 Jul 2015 16:28:37 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZBmmS-0008Jb-VL for pgsql-bugs@arkaria.postgresql.org; Sun, 05 Jul 2015 16:28:37 +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.84) (envelope-from ) id 1ZBmmR-0008HY-Ie for pgsql-bugs@postgresql.org; Sun, 05 Jul 2015 16:28:35 +0000 Received: from jiboia.ensmp.fr ([194.214.158.103]) by makus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1ZBmmO-0000S6-I0 for pgsql-bugs@postgresql.org; Sun, 05 Jul 2015 16:28:34 +0000 Received: from cri.ensmp.fr (AGrenoble-653-1-537-3.w92-129.abo.wanadoo.fr [92.129.173.3]) (authenticated bits=0) by jiboia.ensmp.fr (8.15.1/8.15.1/JMMC-22/Oct/2013) with ESMTPSA id t65GSNaC031133 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NO); Sun, 5 Jul 2015 18:28:24 +0200 Date: Sun, 5 Jul 2015 18:28:22 +0200 (CEST) From: Fabien COELHO X-X-Sender: fabien@sto To: Julien Rouhaud cc: Guillaume Lelarge , mail@bwe.im, Oleksandr Shulgin , PostgreSQL Bugs List Subject: Re: BUG #12379: pgbench should hint to pgbench -i In-Reply-To: <559908D4.7020901@dalibo.com> Message-ID: References: <20141231105955.8014.38426@wrigleys.postgresql.org> <87oales6zm.fsf@ashulgin01.corp.ad.zalando.net> <55984046.60901@dalibo.com> <559908D4.7020901@dalibo.com> User-Agent: Alpine 2.10 (DEB 1266 2009-07-14) MIME-Version: 1.0 Content-Type: MULTIPART/MIXED; BOUNDARY="8323329-463421594-1436113705=:27775" X-Miltered: at jiboia.ensmp.fr with ID 55995B27.000 by Joe's j-chkmail (http : // j-chkmail dot ensmp dot fr)! X-j-chkmail-Auth: USER-ID fabien.coelho X-j-chkmail-Enveloppe: 55995B27.000 from AGrenoble-653-1-537-3.w92-129.abo.wanadoo.fr/AGrenoble-653-1-537-3.w92-129.abo.wanadoo.fr/92.129.173.3/cri.ensmp.fr/ X-Pg-Spam-Score: -2.5 (--) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-bugs Precedence: bulk Sender: pgsql-bugs-owner@postgresql.org This message is in MIME format. The first part should be readable text, while the remaining parts are likely unreadable without MIME-aware tools. --8323329-463421594-1436113705=:27775 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Hello Guillaume & Julien, Thanks for the comments and the improvements! >> I can't look at the code right now, but doesn't it use PQdb() to get the >> name of the database? If it doesn't, it probably should. > > I'm attaching a new version of the patch, which retrieves the actual > database name once connected if needed. That only solves this message > though, the other ones being displayed before the connection is available. I'm not sure it is worth bothering with setting dbname which seems not to be used afterwards anyway. I would suggest to coldly call PQdb on the connection for the error message and thus simplify the code, as attached. -- Fabien. --8323329-463421594-1436113705=:27775 Content-Type: TEXT/x-diff; name=pgbench-hint-6.patch Content-Transfer-Encoding: BASE64 Content-ID: Content-Description: Content-Disposition: attachment; filename=pgbench-hint-6.patch ZGlmZiAtLWdpdCBhL3NyYy9iaW4vcGdiZW5jaC9wZ2JlbmNoLmMgYi9zcmMv YmluL3BnYmVuY2gvcGdiZW5jaC5jDQppbmRleCA5NWJlNjJjLi40Mzk0MWFk IDEwMDY0NA0KLS0tIGEvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KKysr IGIvc3JjL2Jpbi9wZ2JlbmNoL3BnYmVuY2guYw0KQEAgLTMyNDEsNiArMzI0 MSw4IEBAIG1haW4oaW50IGFyZ2MsIGNoYXIgKiphcmd2KQ0KIAkJaWYgKFBR cmVzdWx0U3RhdHVzKHJlcykgIT0gUEdSRVNfVFVQTEVTX09LKQ0KIAkJew0K IAkJCWZwcmludGYoc3RkZXJyLCAiJXMiLCBQUWVycm9yTWVzc2FnZShjb24p KTsNCisJCQlmcHJpbnRmKHN0ZGVyciwgIkhJTlQgcGdiZW5jaDogIGlzIFwi JXNcIiB0aGUgcmlnaHQgZGF0YWJhc2U/ICINCisJCQkJCSJkaWQgeW91IGlu aXRpYWxpemUgZmlyc3QgKC1pKT9cbiIsIFBRZGIoY29uKSk7DQogCQkJZXhp dCgxKTsNCiAJCX0NCiAJCXNjYWxlID0gYXRvaShQUWdldHZhbHVlKHJlcywg MCwgMCkpOw0K --8323329-463421594-1436113705=:27775 Content-Type: text/plain Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs --8323329-463421594-1436113705=:27775--