Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1ZBuMp-0003Ft-Br for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jul 2015 00:34:39 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1ZBuMo-0003JD-J4 for pgsql-bugs@arkaria.postgresql.org; Mon, 06 Jul 2015 00:34:38 +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 1ZBuLz-0002ce-4Z for pgsql-bugs@postgresql.org; Mon, 06 Jul 2015 00:33:47 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1ZBuLv-0001Lb-NV for pgsql-bugs@postgresql.org; Mon, 06 Jul 2015 00:33:45 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id t660XVX3023315; Sun, 5 Jul 2015 20:33:31 -0400 From: Tom Lane To: Fabien COELHO cc: Julien Rouhaud , Guillaume Lelarge , mail@bwe.im, Oleksandr Shulgin , PostgreSQL Bugs List Subject: Re: BUG #12379: pgbench should hint to pgbench -i In-reply-to: References: <20141231105955.8014.38426@wrigleys.postgresql.org> <87oales6zm.fsf@ashulgin01.corp.ad.zalando.net> <55984046.60901@dalibo.com> <559908D4.7020901@dalibo.com> Comments: In-reply-to Fabien COELHO message dated "Sun, 05 Jul 2015 18:28:22 +0200" Date: Sun, 05 Jul 2015 20:33:31 -0400 Message-ID: <23314.1436142811@sss.pgh.pa.us> 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 Fabien COELHO writes: > 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. I looked at this a bit and have a few comments: * I think it might be best to restrict the hint to appear only in the case that the SQLSTATE is ERRCODE_UNDEFINED_TABLE. There are a lot of possible failures here, and I'm not sure this hint is apropos for any but that one. * I really don't care for "HINT pgbench: " as that's got pretty much nothing to do with any other message formatting we have anywhere, least of all the existing hint-like messages in pgbench. I've started a different thread at http://www.postgresql.org/message-id/22280.1436139973@sss.pgh.pa.us to discuss what the general message formatting in pgbench ought to be, and probably this needs to wait for the outcome of that discussion. * I'd be a bit inclined to reduce the message to something like Perhaps you need to do initialization ("pgbench -i") in database "foo" so that we can avoid the question of formatting of multi-sentence hints. regards, tom lane -- Sent via pgsql-bugs mailing list (pgsql-bugs@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-bugs