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

From: Julien Rouhaud <julien(dot)rouhaud(at)dalibo(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Guillaume Lelarge <guillaume(at)lelarge(dot)info>, mail(at)bwe(dot)im, Oleksandr Shulgin <oleksandr(dot)shulgin(at)zalando(dot)de>, PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #12379: pgbench should hint to pgbench -i
Date: 2015-07-18 11:05:04
Message-ID: 55AA32E0.7070006@dalibo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

On 06/07/2015 07:36, Fabien COELHO wrote:
>
>> 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.
>
> Hmmm... the likelyhood of another kind of error is small on:
>
> "select count(*) from pgbench_branches;"
>
> I think the only other possibility would be a permission issue.
>
>> * 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.
>
> It is kind of a copy of postgres hints, but not more than that:
>
> HINT: Consider increasing the configuration parameter "max_wal_size"
>
>> 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.
>
> Yep.
>
>> * 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.
>
> Why not. This sentence hints at one possible error instead of two,
> though, but it may be enough.
>

Here's a v7 patch which display the hint only if SQLSTATE is
ERRCODE_UNDEFINED_TABLE and use the message Tom suggested, as there
wasn't any better suggestion or strong objection with it in the other
thread.
--
Julien Rouhaud
http://dalibo.com - http://dalibo.org

Attachment Content-Type Size
pgbench-hint-7.patch text/x-patch 837 bytes

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Fabien COELHO 2015-07-18 11:49:16 Re: BUG #12379: pgbench should hint to pgbench -i
Previous Message Tobias Pfeiffer 2015-07-18 05:11:31 Re: BUG #13504: Types in math functions table is incorrect