Re: BUG #12379: pgbench should hint to pgbench -i

From: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>
To: Guillaume Lelarge <guillaume(at)lelarge(dot)info>
Cc: mail(at)bwe(dot)im, Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, pgsql-bugs(at)postgresql(dot)org, Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Subject: Re: BUG #12379: pgbench should hint to pgbench -i
Date: 2015-07-05 10:37:08
Message-ID: 559908D4.7020901@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 05/07/2015 08:57, Guillaume Lelarge wrote:
> Le 4 juil. 2015 10:22 PM, "Julien Rouhaud" <julien(dot)rouhaud(at)dalibo(dot)com
> <mailto:julien(dot)rouhaud(at)dalibo(dot)com>> a écrit :
>>
>> On 22/05/2015 11:33, Fabien COELHO wrote:
>> >
>> >>> HINT: is "foo" the right database? did you initialize first (pgbench
>> >>> -i)?
>> >>
>> >> I don't think there is precedent for spitting out "HINT:" in client
> code
>> >> (at least grep didn't find it). So this message might look like it's
>> >> coming from the server, while it doesn't.
>> >
>> > Here is a v3, which makes it clearer that the hint comes from pgbench.
>> >
>> > HINT pgbench: is "foo" the right database? did you initialize first
> (-i)?
>> >
>>
>> Hello,
>>
>> I've just reviewed this patch. First, I've attached a rebased version
>> (v4), as the v3 doesn't apply anymore.
>>
>> The patch is pretty simple, so everything is ok.
>>
>>
>> But I've noticed that if you don't specify any database to pgbench, you
>> get an empty database information:
>>
>> HINT pgbench: is "" the right database? did you initialize
>> first (-i)?
>>
>>
>> This isn't related to this patch specifically, but it may be confusing
>> for users. At least more than the other places it could already appear
>> (debug mode and failed connection attempt).
>>
>> As the database name is optional, wouldn't it be better to fix this
>> behavior?
>>
>
> 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.
>

Well, it doesn't.

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.

--
Julien Rouhaud
http://dalibo.com - http://dalibo.org

Attachment Content-Type Size
pgbench-hint-5.patch text/x-patch 702 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2015-07-05 16:28:22 Re: BUG #12379: pgbench should hint to pgbench -i
Previous Message Guillaume Lelarge 2015-07-05 06:57:02 Re: BUG #12379: pgbench should hint to pgbench -i